소스 검색

[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
Christoph Büscher 6 년 전
부모
커밋
7e6882bbd3
1개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  1. 10 2
      docs/reference/search/request/preference.asciidoc

+ 10 - 2
docs/reference/search/request/preference.asciidoc

@@ -6,8 +6,12 @@ default, Elasticsearch selects from the available shard copies in an
 unspecified order, taking the <<allocation-awareness,allocation awareness>> and
 <<search-adaptive-replica,adaptive replica selection>> configuration into
 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
-per-copy caches.
+searches to certain sets of shard copies.
+
+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:
 
@@ -64,6 +68,10 @@ GET /_search?preference=xyzabc123
 ------------------------------------------------
 // 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
 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,