[Docs] Add to preference parameter docs (#42797)
Adding notes to the existing docs about how using `preference` might increase request cache utilization but also add warning about the downsides. Closes #24278
This commit is contained in:
parent
32eae0dfe9
commit
d9c582e66b
|
@ -6,8 +6,12 @@ default, Elasticsearch selects from the available shard copies in an
|
||||||
unspecified order, taking the <<allocation-awareness,allocation awareness>> and
|
unspecified order, taking the <<allocation-awareness,allocation awareness>> and
|
||||||
<<search-adaptive-replica,adaptive replica selection>> configuration into
|
<<search-adaptive-replica,adaptive replica selection>> configuration into
|
||||||
account. However, it may sometimes be desirable to try and route certain
|
account. However, it may sometimes be desirable to try and route certain
|
||||||
searches to certain sets of shard copies, for instance to make better use of
|
searches to certain sets of shard copies.
|
||||||
per-copy caches.
|
|
||||||
|
A possible use case would be to make use of per-copy caches like the
|
||||||
|
<<shard-request-cache,request cache>>. Doing this, however, runs contrary to the
|
||||||
|
idea of search parallelization and can create hotspots on certain nodes because
|
||||||
|
the load might not be evenly distributed anymore.
|
||||||
|
|
||||||
The `preference` is a query string parameter which can be set to:
|
The `preference` is a query string parameter which can be set to:
|
||||||
|
|
||||||
|
@ -64,6 +68,10 @@ GET /_search?preference=xyzabc123
|
||||||
------------------------------------------------
|
------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
|
|
||||||
|
This can be an effective strategy to increase usage of e.g. the request cache for
|
||||||
|
unique users running similar searches repeatedly by always hitting the same cache, while
|
||||||
|
requests of different users are still spread across all shard copies.
|
||||||
|
|
||||||
NOTE: The `_only_local` preference guarantees only to use shard copies on the
|
NOTE: The `_only_local` preference guarantees only to use shard copies on the
|
||||||
local node, which is sometimes useful for troubleshooting. All other options do
|
local node, which is sometimes useful for troubleshooting. All other options do
|
||||||
not _fully_ guarantee that any particular shard copies are used in a search,
|
not _fully_ guarantee that any particular shard copies are used in a search,
|
||||||
|
|
Loading…
Reference in New Issue