2020-04-07 07:28:53 -04:00
|
|
|
[role="xpack"]
|
2020-08-03 07:18:06 -04:00
|
|
|
[testenv="enterprise"]
|
2020-04-07 07:28:53 -04:00
|
|
|
[[searchable-snapshots-api-clear-cache]]
|
|
|
|
=== Clear cache API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Clear cache</titleabbrev>
|
|
|
|
++++
|
|
|
|
|
|
|
|
experimental[]
|
|
|
|
|
|
|
|
Clear the cache of searchable snapshots.
|
|
|
|
|
|
|
|
[[searchable-snapshots-api-clear-cache-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
|
|
|
`POST /_searchable_snapshots/cache/clear`
|
|
|
|
|
2020-07-13 09:05:27 -04:00
|
|
|
`POST /<target>/_searchable_snapshots/cache/clear`
|
2020-04-07 07:28:53 -04:00
|
|
|
|
|
|
|
[[searchable-snapshots-api-clear-cache-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
|
|
|
If the {es} {security-features} are enabled, you must have the
|
|
|
|
`manage` cluster privilege and the `manage` index privilege
|
|
|
|
for any included indices to use this API.
|
|
|
|
For more information, see <<security-privileges>>.
|
|
|
|
|
|
|
|
[[searchable-snapshots-api-clear-cache-desc]]
|
|
|
|
==== {api-description-title}
|
|
|
|
|
|
|
|
|
|
|
|
[[searchable-snapshots-api-clear-cache-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
2020-07-13 09:05:27 -04:00
|
|
|
`<target>`::
|
2020-04-07 07:28:53 -04:00
|
|
|
(Optional, string)
|
2020-07-13 09:05:27 -04:00
|
|
|
A comma-separated list of data streams and indices for which the
|
2020-04-07 07:28:53 -04:00
|
|
|
searchable snapshots cache must be cleared.
|
|
|
|
|
|
|
|
|
|
|
|
[[searchable-snapshots-api-clear-cache-example]]
|
|
|
|
==== {api-examples-title}
|
|
|
|
////
|
|
|
|
[source,console]
|
|
|
|
-----------------------------------
|
|
|
|
PUT /docs
|
|
|
|
{
|
2020-07-21 15:49:58 -04:00
|
|
|
"settings" : {
|
|
|
|
"index.number_of_shards" : 1,
|
|
|
|
"index.number_of_replicas" : 0
|
|
|
|
}
|
2020-04-07 07:28:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
|
|
|
|
{
|
2020-07-21 15:49:58 -04:00
|
|
|
"include_global_state": false,
|
|
|
|
"indices": "docs"
|
2020-04-07 07:28:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
DELETE /docs
|
|
|
|
|
|
|
|
POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true
|
|
|
|
{
|
|
|
|
"index": "docs"
|
|
|
|
}
|
|
|
|
-----------------------------------
|
|
|
|
// TEST[setup:setup-repository]
|
|
|
|
////
|
|
|
|
|
|
|
|
Clears the cache of the index `docs`:
|
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
|
|
|
POST /docs/_searchable_snapshots/cache/clear
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|