If you use the Security plugin, you must have the privileges.
All query parameters are optional.
Example requests
The following example requests show multiple clear cache API uses.
Clear a specific cache
The following request clears the fields cache only:
copy
POST /my-index/_cache/clear?query=true
copy
The following request clears the request cache only:
copy
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
copy
Clear caches for specific data streams and indexes
copy
Clear caches for all data streams and indexes
The following request clears the cache for all data streams and indexes:
copy
Example response
The POST /books,hockey/_cache/clear
request returns the following fields:
The POST /books,hockey/_cache/clear
request returns the following response fields: