clearcache.asciidoc 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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` or `query_cache`.
  11. All caches relating to a specific field(s) can also be cleared by
  12. specifying `fields` parameter with a comma delimited list of the
  13. relevant fields.
  14. [float]
  15. === Multi Index
  16. The clear cache API can be applied to more than one index with a single
  17. call, or even on `_all` the indices.
  18. [source,js]
  19. --------------------------------------------------
  20. $ curl -XPOST 'http://localhost:9200/kimchy,elasticsearch/_cache/clear'
  21. $ curl -XPOST 'http://localhost:9200/_cache/clear'
  22. --------------------------------------------------
  23. NOTE: The `filter` cache is not cleared immediately but is scheduled to be
  24. cleared within 60 seconds.