<commit_before>[[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
cleaned explicitly by setting `filter`, `field_data` or `id_cache` to
`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'
--------------------------------------------------<commit_msg>[DOCS] Added note about dely in clearing filter cache.<commit_after>[[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
cleaned explicitly by setting `filter`, `field_data` or `id_cache` to
`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'
--------------------------------------------------

NOTE: The `filter` cache is not cleared immediately but is scheduled to be
cleared within 60 seconds.
{'fraction_non_alphanumeric': 0.25710357470210815, 'fraction_numerical': 0.011915673693858845, 'mean_word_length': 2.053146853146853, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1678630', 'n_tokens_mistral': 556, 'n_tokens_neox': 532, 'n_words': 233}