Skip to content

Commit 09c8bcf

Browse files
szabostevedebadair
andcommitted
[DOCS] Expands the documentation of Node Query Cache (#51105)
Co-authored-by: debadair <[email protected]>
1 parent b30f819 commit 09c8bcf

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed
Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
[[query-cache]]
22
=== Node Query Cache
33

4-
The query cache is responsible for caching the results of queries.
5-
There is one queries cache per node that is shared by all shards.
6-
The cache implements an LRU eviction policy: when a cache becomes full, the
7-
least recently used data is evicted to make way for new data.
8-
It is not possible to look at the contents being cached.
4+
The results of queries used in the filter context are cached in the node query
5+
cache for fast lookup. There is one queries cache per node that is shared by all
6+
shards. The cache uses an LRU eviction policy: when the cache is full, the least
7+
recently used query results are evicted to make way for new data. You cannot
8+
inspect the contents of the query cache.
99

10-
The query cache only caches queries which are being used in a filter context.
10+
Term queries and queries used outside of a filter context are not eligible for
11+
caching.
12+
13+
By default, the cache holds a maximum of 10000 queries in up to 10% of the total
14+
heap space. To determine if a query is eligible for caching, {es} maintains a
15+
query history to track occurrences.
16+
17+
Caching is done on a per segment basis if a segment contains at least 10000
18+
documents and the segment has at least 3% of the total documents of a shard.
19+
Because caching is per segment, merging segments can invalidate cached queries.
1120

1221
The following setting is _static_ and must be configured on every data node in
1322
the cluster:
1423

1524
`indices.queries.cache.size`::
16-
1725
Controls the memory size for the filter cache , defaults to `10%`. Accepts
1826
either a percentage value, like `5%`, or an exact value, like `512mb`.
1927

20-
The following setting is an _index_ setting that can be configured on a
28+
The following setting is an _index_ setting that can be configured on a
2129
per-index basis. Can only be set at index creation time or on a
2230
<<indices-open-close,closed index>>:
2331

2432
`index.queries.cache.enabled`::
25-
2633
Controls whether to enable query caching. Accepts `true` (default) or
2734
`false`.

0 commit comments

Comments
 (0)