diff --git a/_opensearch/rest-api/index-apis/close-index.md b/_opensearch/rest-api/index-apis/close-index.md new file mode 100644 index 00000000..8c2d09a4 --- /dev/null +++ b/_opensearch/rest-api/index-apis/close-index.md @@ -0,0 +1,53 @@ +--- +layout: default +title: Close index +parent: Index APIs +grand_parent: REST API reference +nav_order: 30 +--- + +# Close index +Introduced 1.0 +{: .label .label-purple } + +The close index API operation closes an index. Once an index is closed, you cannot add data to it or search for any data within the index. + +## Example + +```json +POST /sample-index/_close +``` + +## Path and HTTP methods + +``` +POST //_close +``` + +## URL parameters + +All parameters are optional. + +Parameter | Type | Description +:--- | :--- | :--- +<index-name> | String | The index to close. Can be a comma-separated list of multiple index names. Use `_all` or * to close 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, + "indices": { + "sample-index1": { + "closed": true + } + } +} +``` diff --git a/_opensearch/rest-api/index-apis/delete-index.md b/_opensearch/rest-api/index-apis/delete-index.md index 953225e0..ab6377a0 100644 --- a/_opensearch/rest-api/index-apis/delete-index.md +++ b/_opensearch/rest-api/index-apis/delete-index.md @@ -3,7 +3,7 @@ layout: default title: Delete index parent: Index APIs grand_parent: REST API reference -nav_order: 5 +nav_order: 10 --- # Delete index diff --git a/_opensearch/rest-api/index-apis/exists.md b/_opensearch/rest-api/index-apis/exists.md new file mode 100644 index 00000000..3a156277 --- /dev/null +++ b/_opensearch/rest-api/index-apis/exists.md @@ -0,0 +1,43 @@ +--- +layout: default +title: Index exists +parent: Index APIs +grand_parent: REST API reference +nav_order: 5 +--- + +# Index exists +Introduced 1.0 +{: .label .label-purple } + +The index exists API operation returns whether or not an index already exists. + +## Example + +```json +HEAD /sample-index +``` + +## Path and HTTP methods + +``` +HEAD / +``` + +## URL parameters + +All parameters are optional. + +Parameter | Type | Description +:--- | :--- | :--- +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. +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 | Boolean | Whether to include default settings as part of the response. This parameter is useful for identifying the names and current values of settings you want to update. +ignore_unavailable | Boolean | If true, OpenSearch does not search for missing or closed indices. Default is false. +local | Boolean | Whether to return information from only the local node instead of from the master node. Default is false. + + +## Response + +The index exists API operation returns only one of two possible response codes: `200` -- the index exists, and `404` -- the index does not exist. diff --git a/_opensearch/rest-api/index-apis/get-index.md b/_opensearch/rest-api/index-apis/get-index.md index 3716b495..7e37a6ee 100644 --- a/_opensearch/rest-api/index-apis/get-index.md +++ b/_opensearch/rest-api/index-apis/get-index.md @@ -3,7 +3,7 @@ layout: default title: Get index parent: Index APIs grand_parent: REST API reference -nav_order: 10 +nav_order: 20 --- # Get index