Skip to content

Commit

Permalink
Refactor common params
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Dec 11, 2024
1 parent 318c6c5 commit 8ade227
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
8 changes: 2 additions & 6 deletions docs/reference/query-dsl/knn-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,8 @@ documents are then scored according to <<dense-vector-similarity, `similarity`>>
and the provided `boost` is applied.
--

`rescore`::
+
--
(Optional, object) Rescoring to apply to quantized vectors.
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=knn-rescore]
--
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=knn-rescore-vector]


`boost`::
+
Expand Down
18 changes: 11 additions & 7 deletions docs/reference/rest-api/common-parms.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1347,18 +1347,22 @@ Applies the specified <<query-dsl-bool-query, boolean query filter>> to all of t
according to each retriever's specifications.
end::rrf-filter[]

tag::knn-rescore[]
tag::knn-rescore-vector[]

`rescore_vector`::
+
--
(Optional, object) Functionality in preview:[]. Apply oversampling and rescoring to quantized vectors.

NOTE: Rescoring only makes sense for quantized vectors; when <<dense-vector-quantization,quantization>> is not used, the original vectors are used for scoring.
Rescore option will be ignored for non-quantized `dense_vector` fields.

`oversample`::
`num_candidates_factor`::
(Required, float)
+
Applies the specified oversample factor to the approximate kNN search.
The approximate kNN search will retrieve the top `k * oversample` candidates per shard,
and then use the original vectors for rescoring.
The top `k` rescored candidates will be returned as results.
Applies the specified oversample factor to the number of candidates on the approximate kNN search.
The approximate kNN search will retrieve `num_candidates * num_candidates_factor` candidates per shard, and then use the original vectors for rescoring them.

See <<dense-vector-knn-search-reranking,oversampling and rescoring quantized vectors>> for details.
end::knn-rescore[]
--
end::knn-rescore-vector[]
7 changes: 1 addition & 6 deletions docs/reference/search/retriever.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,7 @@ include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=knn-filter]
+
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=knn-similarity]

`rescore`::
+
--
(Optional, object) Rescoring to apply to quantized vectors.
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=knn-rescore]
--
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=knn-rescore-vector]

===== Restrictions

Expand Down

0 comments on commit 8ade227

Please sign in to comment.