Taken from docs: https://www.elastic.co/guide/en/elasticsearch/reference/7.9/shard-request-cache.html#shard-request-cache
By default, the requests cache will only cache the results of search requests where
size=0
, so it will not cache hits, but it will cachehits.total
,aggregations
, andsuggestions
.Most queries that use now (see Date Math) cannot be cached.
Scripted queries that use the API calls which are non-deterministic, such as
Math.random()
ornew Date()
are not cached.
However how does this play with _count queries? _count queries behave almost exactly the same as _search queries with size=0
?
I'd expect request cache to cache count queries as well, but couldn't find any information about it.