2018-11-27 20:40:49 -05:00
|
|
|
--
|
|
|
|
:api: clear-cache
|
|
|
|
:request: ClearIndicesCacheRequest
|
|
|
|
:response: ClearIndicesCacheResponse
|
|
|
|
--
|
|
|
|
|
|
|
|
[id="{upid}-{api}"]
|
2018-03-20 05:39:36 -04:00
|
|
|
=== Clear Cache API
|
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
[id="{upid}-{api}-request"]
|
2018-03-20 05:39:36 -04:00
|
|
|
==== Clear Cache Request
|
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
A +{request}+ can be applied to one or more indices, or even on
|
2018-03-20 05:39:36 -04:00
|
|
|
`_all` the indices:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request]
|
2018-03-20 05:39:36 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Clears the cache of one index
|
|
|
|
<2> Clears the cache of multiple indices
|
|
|
|
<3> Clears the cache of all the indices
|
|
|
|
|
|
|
|
==== Optional arguments
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request-indicesOptions]
|
2018-03-20 05:39:36 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Setting `IndicesOptions` controls how unavailable indices are resolved and
|
|
|
|
how wildcard expressions are expanded
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request-query]
|
2018-03-20 05:39:36 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Set the `query` flag to `true`
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request-fielddata]
|
2018-03-20 05:39:36 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Set the `fielddata` flag to `true`
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request-request]
|
2018-03-20 05:39:36 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Set the `request` flag to `true`
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request-fields]
|
2018-03-20 05:39:36 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Set the `fields` parameter
|
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
include::../execution.asciidoc[]
|
2018-03-20 05:39:36 -04:00
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
[id="{upid}-{api}-response"]
|
2018-03-20 05:39:36 -04:00
|
|
|
==== Clear Cache Response
|
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
The returned +{response}+ allows to retrieve information about the
|
2018-03-20 05:39:36 -04:00
|
|
|
executed operation as follows:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-response]
|
2018-03-20 05:39:36 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Total number of shards hit by the clear cache request
|
|
|
|
<2> Number of shards where the clear cache has succeeded
|
|
|
|
<3> Number of shards where the clear cache has failed
|
|
|
|
<4> A list of failures if the operation failed on one or more shards
|
|
|
|
|
|
|
|
By default, if the indices were not found, an `ElasticsearchException` will be thrown:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-notfound]
|
2018-03-20 05:39:36 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Do something if the indices to be cleared were not found
|