diff --git a/_opensearch/rest-api/alias.md b/_opensearch/rest-api/alias.md index 99861d6a..458d79bf 100644 --- a/_opensearch/rest-api/alias.md +++ b/_opensearch/rest-api/alias.md @@ -2,7 +2,7 @@ layout: default title: Alias parent: REST API reference -nav_order: 5 +nav_order: 20 --- # Alias @@ -67,7 +67,7 @@ aliases | Array | Array of alias names. | Yes if you don't supply an `alias` fie filter | Object | A filter to use with the alias, so the alias points to a filtered part of the index. | No is_hidden | Boolean | Specifies whether the alias should be hidden from results that include wildcard expressions | No must_exist | Boolean | Specifies whether the alias to remove must exist. | No -is_write_index | Boolean | Specifies whether the index should be a write index. An alias can only have one write index at a time. | No +is_write_index | Boolean | Specifies whether the index should be a write index. An alias can only have one write index at a time. If a write request is submitted to a alias that links to multiple indexes, OpenSearch executes the request only on the write index. | No routing | String | Used to assign a custom value to a shard for specific operations. | No index_routing | String | Assigns a custom value to a shard only for index operations. | No search_routing | String | Assigns a custom value to a shard only for search operations. | No diff --git a/_opensearch/rest-api/cluster-allocation.md b/_opensearch/rest-api/cluster-allocation.md index 07caee47..34735b5a 100644 --- a/_opensearch/rest-api/cluster-allocation.md +++ b/_opensearch/rest-api/cluster-allocation.md @@ -2,7 +2,7 @@ layout: default title: Cluster allocation explain parent: REST API reference -nav_order: 10 +nav_order: 50 --- # Cluster allocation explain diff --git a/_opensearch/rest-api/cluster-health.md b/_opensearch/rest-api/cluster-health.md index 339c4398..64c7a909 100644 --- a/_opensearch/rest-api/cluster-health.md +++ b/_opensearch/rest-api/cluster-health.md @@ -2,7 +2,7 @@ layout: default title: Cluster health parent: REST API reference -nav_order: 15 +nav_order: 55 --- # Cluster health diff --git a/_opensearch/rest-api/cluster-settings.md b/_opensearch/rest-api/cluster-settings.md index e8780010..7c8b9870 100644 --- a/_opensearch/rest-api/cluster-settings.md +++ b/_opensearch/rest-api/cluster-settings.md @@ -2,7 +2,7 @@ layout: default title: Cluster settings parent: REST API reference -nav_order: 20 +nav_order: 60 --- # Cluster settings diff --git a/_opensearch/rest-api/document-apis/index.md b/_opensearch/rest-api/document-apis/index.md index 7c8eda9a..2014e45f 100644 --- a/_opensearch/rest-api/document-apis/index.md +++ b/_opensearch/rest-api/document-apis/index.md @@ -3,7 +3,7 @@ layout: default title: Document APIs parent: REST API reference has_children: true -nav_order: 7 +nav_order: 40 redirect_from: - /opensearch/rest-api/document-apis/ --- diff --git a/_opensearch/rest-api/index-apis/open-index.md b/_opensearch/rest-api/index-apis/open-index.md new file mode 100644 index 00000000..cfbb4565 --- /dev/null +++ b/_opensearch/rest-api/index-apis/open-index.md @@ -0,0 +1,48 @@ +--- +layout: default +title: Open index +parent: Index APIs +grand_parent: REST API reference +nav_order: 40 +--- + +# Open index +Introduced 1.0 +{: .label .label-purple } + +The open index API operation opens a closed index, letting you add or search for data within the index. + +## Example + +```json +POST /sample-index/_open +``` + +## Path and HTTP methods + +``` +POST //_open +``` + +## URL parameters + +All parameters are optional. + +Parameter | Type | Description +:--- | :--- | :--- +<index-name> | String | The index to open. Can be a comma-separated list of multiple index names. Use `_all` or * to open all indices. +allow_no_indices | Boolean | Whether to ignore wildcards that don't match any indices. Default is true. +expand_wildcards | String | Expands wildcard expressions to different indices. Combine multiple values with commas. Available values are all (match all indices), open (match open indices), closed (match closed indices), hidden (match hidden indices), and none (do not accept wildcard expressions). Default is open. +ignore_unavailable | Boolean | If true, OpenSearch does not search for missing or closed indices. Default is false. +wait_for_active_shards | String | Specifies the number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the request to succeed. +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 response from the cluster. Default is `30s`. + + +## Response +```json +{ + "acknowledged": true, + "shards_acknowledged": true +} +``` diff --git a/_opensearch/rest-api/put-mapping.md b/_opensearch/rest-api/put-mapping.md new file mode 100644 index 00000000..349cec39 --- /dev/null +++ b/_opensearch/rest-api/put-mapping.md @@ -0,0 +1,75 @@ +--- +layout: default +title: Put mapping +parent: REST API reference +nav_order: 30 +--- + +# Put mapping +Introduced 1.0 +{: .label .label-purple } + +The put mapping API operation lets you add new mappings and fields to an index. + +## Example + +```json +PUT /sample-index/_mapping +{ + "properties": { + "age": { + "type": "integer" + }, + "occupation":{ + "type": "text" + } + } +} +``` + + +## Path and HTTP methods + +``` +PUT //_mapping +PUT /_mapping +``` + +## URL parameters + +All put mapping parameters are optional. + +Parameter | Data Type | Description +:--- | :--- | :--- +<target-index> | Data Type | The index to add the mapping to. If you do not specify this parameter, OpenSearch adds the mapping to all indices within the cluster. +allow_no_indices | Boolean | Whether to ignore wildcards that don’t match any indices. Default is `true`. +expand_wildcards | String | Expands wildcard expressions to different indices. Combine multiple values with commas. Available values are `all` (match all indices), `open` (match open indices), `closed` (match closed indices), `hidden` (match hidden indices), and `none` (do not accept wildcard expressions), which must be used with `open`, `closed`, or both. Default is `open`. +ignore_unavailable | Boolean | If true, OpenSearch does not include missing or closed indices in the response. +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 response from the cluster. Default is `30s`. +write_index_only | Boolean | Whether OpenSearch should add the mapping only to write indexes. If false, OpenSearch can add the mapping to all indexes with the same alias. See [alias]({{site.url}}{{site.baseurl}}/opensearch/rest-api/alias/#request-body) for more information. Default is false. + +## Request body + +The request body must contain the `properties` object, which has all of the mappings that you want to add. + +```json +{ + "properties":{ + "color":{ + "type": "text" + }, + "year":{ + "type": "integer" + } + } +} +``` + +## Response + +```json +{ + "acknowledged": true +} +``` diff --git a/_opensearch/rest-api/remote-info.md b/_opensearch/rest-api/remote-info.md index e9d88402..26a656d4 100644 --- a/_opensearch/rest-api/remote-info.md +++ b/_opensearch/rest-api/remote-info.md @@ -2,7 +2,7 @@ layout: default title: Remote cluster information parent: REST API reference -nav_order: 25 +nav_order: 70 --- # Remote cluster information diff --git a/_opensearch/rest-api/search.md b/_opensearch/rest-api/search.md index b08e6e3e..23834eea 100644 --- a/_opensearch/rest-api/search.md +++ b/_opensearch/rest-api/search.md @@ -2,7 +2,7 @@ layout: default title: Search parent: REST API reference -nav_order: 4 +nav_order: 10 --- # Search diff --git a/_opensearch/rest-api/update-mapping.md b/_opensearch/rest-api/update-mapping.md index 9cd9728c..2b1c0202 100644 --- a/_opensearch/rest-api/update-mapping.md +++ b/_opensearch/rest-api/update-mapping.md @@ -2,7 +2,7 @@ layout: default title: Update mapping parent: REST API reference -nav_order: 6 +nav_order: 35 --- # Update mapping diff --git a/images/cli.gif b/images/cli.gif index e55c47ba..20299ddb 100644 Binary files a/images/cli.gif and b/images/cli.gif differ