clearcache.asciidoc 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. [[indices-clearcache]]
  2. == Clear Cache
  3. The clear cache API allows to clear either all caches or specific cached
  4. associated with one ore more indices.
  5. [source,js]
  6. --------------------------------------------------
  7. $ curl -XPOST 'http://localhost:9200/twitter/_cache/clear'
  8. --------------------------------------------------
  9. The API, by default, will clear all caches. Specific caches can be cleaned
  10. explicitly by setting `filter`, `fielddata`, `query_cache`,
  11. or `id_cache` to `true`.
  12. All caches relating to a specific field(s) can also be cleared by
  13. specifying `fields` parameter with a comma delimited list of the
  14. relevant fields.
  15. [float]
  16. === Multi Index
  17. The clear cache API can be applied to more than one index with a single
  18. call, or even on `_all` the indices.
  19. [source,js]
  20. --------------------------------------------------
  21. $ curl -XPOST 'http://localhost:9200/kimchy,elasticsearch/_cache/clear'
  22. $ curl -XPOST 'http://localhost:9200/_cache/clear'
  23. --------------------------------------------------
  24. NOTE: The `filter` cache is not cleared immediately but is scheduled to be
  25. cleared within 60 seconds.