2013-08-28 19:24:34 -04:00
|
|
|
[[indices-clearcache]]
|
|
|
|
== Clear Cache
|
|
|
|
|
|
|
|
The clear cache API allows to clear either all caches or specific cached
|
|
|
|
associated with one ore more indices.
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
$ curl -XPOST 'http://localhost:9200/twitter/_cache/clear'
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
The API, by default, will clear all caches. Specific caches can be
|
2014-01-09 15:08:45 -05:00
|
|
|
cleaned explicitly by setting `filter`, `field_data` or `id_cache` to
|
2013-08-28 19:24:34 -04:00
|
|
|
`true`.
|
|
|
|
|
|
|
|
All caches relating to a specific field(s) can also be cleared by
|
|
|
|
specifying `fields` parameter with a comma delimited list of the
|
|
|
|
relevant fields.
|
|
|
|
|
|
|
|
[float]
|
|
|
|
=== Multi Index
|
|
|
|
|
|
|
|
The clear cache API can be applied to more than one index with a single
|
|
|
|
call, or even on `_all` the indices.
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
$ curl -XPOST 'http://localhost:9200/kimchy,elasticsearch/_cache/clear'
|
|
|
|
|
|
|
|
$ curl -XPOST 'http://localhost:9200/_cache/clear'
|
|
|
|
--------------------------------------------------
|
2014-02-24 05:36:22 -05:00
|
|
|
|
|
|
|
NOTE: The `filter` cache is not cleared immediately but is scheduled to be
|
|
|
|
cleared within 60 seconds.
|