New

The executive guide to generative AI

Read more

Clear Cache

edit

The clear cache API allows to clear either all caches or specific cached associated with one or more indices.

POST /twitter/_cache/clear

The API, by default, will clear all caches. Specific caches can be cleaned explicitly by setting the query, fielddata or request url parameter to true.

POST /twitter/_cache/clear?query=true      
POST /twitter/_cache/clear?request=true    
POST /twitter/_cache/clear?fielddata=true   

Cleans only the query cache

Cleans only the request cache

Cleans only the fielddata cache

In addition to this, all caches relating to a specific field can also be cleared by specifying fields url parameter with a comma delimited list of the fields that should be cleared. Note that the provided names must refer to concrete fields — objects and field aliases are not supported.

POST /twitter/_cache/clear?fields=foo,bar   

Clear the cache for the foo an bar field

Multi Index

edit

The clear cache API can be applied to more than one index with a single call, or even on _all the indices.

POST /kimchy,elasticsearch/_cache/clear

POST /_cache/clear

On this page

Was this helpful?
Feedback