-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCS] Separate and reformat close index API docs (#45922)
- Loading branch information
Showing
3 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
[[indices-close]] | ||
=== Close index API | ||
++++ | ||
<titleabbrev>Close index</titleabbrev> | ||
++++ | ||
|
||
Closes an index. | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
POST /twitter/_close | ||
-------------------------------------------------- | ||
// CONSOLE | ||
// TEST[setup:twitter] | ||
|
||
|
||
[[close-index-api-request]] | ||
==== {api-request-title} | ||
|
||
`POST /<index>/_close` | ||
|
||
|
||
[[close-index-api-desc]] | ||
==== {api-description-title} | ||
|
||
You use the close index API to close open indices. | ||
|
||
include::{docdir}/indices/open-close.asciidoc[tag=closed-index] | ||
|
||
|
||
[[close-index-api-path-params]] | ||
==== {api-path-parms-title} | ||
|
||
include::{docdir}/rest-api/common-parms.asciidoc[tag=index] | ||
+ | ||
To close all indices, use `_all` or `*`. | ||
To disallow the closing of indices with `_all` or wildcard expressions, | ||
change the `action.destructive_requires_name` cluster setting to `true`. | ||
You can update this setting in the `elasticsearch.yml` file | ||
or using the <<cluster-update-settings,cluster update settings>> API. | ||
|
||
|
||
[[close-index-api-query-params]] | ||
==== {api-query-parms-title} | ||
|
||
include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices] | ||
|
||
include::{docdir}/rest-api/common-parms.asciidoc[tag=expand-wildcards] | ||
+ | ||
Defaults to `open`. | ||
|
||
include::{docdir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable] | ||
|
||
include::{docdir}/rest-api/common-parms.asciidoc[tag=doc-wait-for-active-shards] | ||
|
||
include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms] | ||
|
||
|
||
[[close-index-api-example]] | ||
==== {api-examples-title} | ||
|
||
The following example shows how to close an index: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
POST /my_index/_close | ||
-------------------------------------------------- | ||
// CONSOLE | ||
// TEST[s/^/PUT my_index\n/] | ||
|
||
The API returns following response: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
{ | ||
"acknowledged" : true, | ||
"shards_acknowledged" : true, | ||
"indices" : { | ||
"my_index" : { | ||
"closed" : true | ||
} | ||
} | ||
} | ||
-------------------------------------------------- | ||
// TESTRESPONSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters