If you use the security plugin, you must have the privileges.
All query parameters are optional.
Sample requests
The following sample requests show multiple clear cache API uses.
Clear a specific cache
The following request clears the query cache only:
POST /my-index/_cache/clear?query=true
The following request clears the request cache only:
Clear the cache for specific fields
The following request clears the fields caches of fielda
and fieldb
:
POST /my-index/_cache/clear?fields=fielda,fieldb
Clear caches for specific data streams and indexes
Clear caches for all data streams and indexes
The following request clears the cache for all data streams and indexes:
Sample response
The POST /books,hockey/_cache/clear
request returns the following fields:
The POST /books,hockey/_cache/clear
request returns the following response fields: