diff --git a/_opensearch/rest-api/index-apis/get-settings.md b/_opensearch/rest-api/index-apis/get-settings.md new file mode 100644 index 00000000..319b193f --- /dev/null +++ b/_opensearch/rest-api/index-apis/get-settings.md @@ -0,0 +1,64 @@ +--- +layout: default +title: Get settings +parent: Index APIs +grand_parent: REST API reference +nav_order: 100 +--- + +# Get settings +Introduced 1.0 +{: .label .label-purple } + +The get settings API operation returns all the settings in your index. + +## Example + +```json +GET /sample-index1/_settings +``` + +## Path and HTTP methods + +``` +GET //_settings +GET //_settings/ +``` + +## URL parameters + +All update settings parameters are optional. + +Parameter | Data Type | Description +:--- | :--- | :--- +<target-index> | String | The index to get settings from. Can be a comma-separated list to get settings from multiple indexes, or use `_all` to return settings from all indexes within the cluster. +<setting> | String | Filter to return specific settings. +allow_no_indices | Boolean | Whether to ignore wildcards that don’t match any indexes. Default is `true`. +expand_wildcards | String | Expands wildcard expressions to different indexes. Combine multiple values with commas. Available values are `all` (match all indexes), `open` (match open indexes), `closed` (match closed indexes), `hidden` (match hidden indexes), and `none` (do not accept wildcard expressions), which must be used with `open`, `closed`, or both. Default is `open`. +flat_settings | Boolean | Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of “index”: { “creation_date”: “123456789” } is “index.creation_date”: “123456789”. +include_defaults | String | Whether to include default settings, including settings used within OpenSearch's plugins, in the response. Default is false. +ignore_unavailable | Boolean | If true, OpenSearch does not include missing or closed indexes in the response. +local | Boolean | Whether to return information from the local node only instead of the master node. Default is false. +master_timeout | Time | How long to wait for a connection to the master node. Default is `30s`. + +## Response + +```json +{ + "sample-index1": { + "settings": { + "index": { + "creation_date": "1622672553417", + "number_of_shards": "1", + "number_of_replicas": "1", + "uuid": "GMEA0_TkSaamrnJSzNLzwg", + "version": { + "created": "135217827", + "upgraded": "135238227" + }, + "provided_name": "sample-index1" + } + } + } +} +``` diff --git a/_opensearch/rest-api/put-mapping.md b/_opensearch/rest-api/index-apis/put-mapping.md similarity index 96% rename from _opensearch/rest-api/put-mapping.md rename to _opensearch/rest-api/index-apis/put-mapping.md index 349cec39..771a7a42 100644 --- a/_opensearch/rest-api/put-mapping.md +++ b/_opensearch/rest-api/index-apis/put-mapping.md @@ -1,8 +1,9 @@ --- layout: default title: Put mapping -parent: REST API reference -nav_order: 30 +parent: Index APIs +grand_parent: REST API reference +nav_order: 200 --- # Put mapping diff --git a/_opensearch/rest-api/update-mapping.md b/_opensearch/rest-api/index-apis/update-mapping.md similarity index 97% rename from _opensearch/rest-api/update-mapping.md rename to _opensearch/rest-api/index-apis/update-mapping.md index 2b1c0202..22f4aa9a 100644 --- a/_opensearch/rest-api/update-mapping.md +++ b/_opensearch/rest-api/index-apis/update-mapping.md @@ -1,8 +1,9 @@ --- layout: default title: Update mapping -parent: REST API reference -nav_order: 35 +parent: Index APIs +grand_parent: REST API reference +nav_order: 220 --- # Update mapping diff --git a/_opensearch/rest-api/index-apis/update-settings.md b/_opensearch/rest-api/index-apis/update-settings.md new file mode 100644 index 00000000..b93f0cc4 --- /dev/null +++ b/_opensearch/rest-api/index-apis/update-settings.md @@ -0,0 +1,68 @@ +--- +layout: default +title: Update settings +parent: Index APIs +grand_parent: REST API reference +nav_order: 120 +--- + +# Update settings +Introduced 1.0 +{: .label .label-purple } + +You can use the update settings API operation to update index-level settings. You can change dynamic index settings at any time, but static settings cannot be changed after index creation. For more information about static and dynamic index settings, see [Create index]({{site.url}}{{site.baseurl}}/opensearch/rest-api/index-apis/create-index/#index-settings). + +Aside from the static and dynamic index settings, you can also update individual plugins' settings. To get the full list of updatable settings, run `GET /_settings?include_defaults=true`. + +## Example + +```json +PUT /sample-index1/_settings +{ + "index.plugins.index_state_management.rollover_skip": true, + "index": { + "number_of_replicas": 4 + } +} +``` + +## Path and HTTP methods + +``` +PUT //_settings +``` + +## URL parameters + +All update settings parameters are optional. + +Parameter | Data Type | Description +:--- | :--- | :--- +allow_no_indices | Boolean | Whether to ignore wildcards that don’t match any indexes. Default is `true`. +expand_wildcards | String | Expands wildcard expressions to different indexes. Combine multiple values with commas. Available values are `all` (match all indexes), `open` (match open indexes), `closed` (match closed indexes), `hidden` (match hidden indexes), and `none` (do not accept wildcard expressions), which must be used with `open`, `closed`, or both. Default is `open`. +flat_settings | Boolean | Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of “index”: { “creation_date”: “123456789” } is “index.creation_date”: “123456789”. +ignore_unavailable | Boolean | If true, OpenSearch does not include missing or closed indexes in the response. +preserve_existing | Boolean | Whether to preserve existing index settings. Default is false. +master_timeout | Time | How long to wait for a connection to the master node. Default is `30s`. +timeout | Time | How long to wait for a connection to return. Default is `30s`. + +## Request body + +The request body must all of the index settings that you want to update. + +```json +{ + "index.plugins.index_state_management.rollover_skip": true, + "index": { + "number_of_replicas": 4 + } +} +``` + +## Response + +```json +{ + "acknowledged": true +} +```