You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/elasticsearch/rest-apis/retrievers.md
+46-7Lines changed: 46 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,6 +199,10 @@ A kNN retriever returns top documents from a [k-nearest neighbor search (kNN)](d
199
199
200
200
Read more here: [knn similarity search](docs-content://solutions/search/vector/knn.md#knn-similarity-search)
201
201
202
+
`min_score`
203
+
: (Optional, `float`)
204
+
205
+
Minimum [`_score`](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) for matching documents. Documents with a lower `_score` are not included in the top documents.
202
206
203
207
`rescore_vector`
204
208
: (Optional, object) Apply oversampling and rescoring to quantized vectors.
@@ -259,7 +263,7 @@ A retriever that normalizes and linearly combines the scores of other retrievers
259
263
#### Parameters [linear-retriever-parameters]
260
264
261
265
`retrievers`
262
-
: (Required, array of objects)
266
+
: (Optional, array of objects)
263
267
264
268
A list of the sub-retrievers' configuration, that we will take into account and whose result sets we will merge through a weighted sum. Each configuration can have a different weight and normalization depending on the specified retriever.
265
269
@@ -272,12 +276,12 @@ Each entry specifies the following parameters:
272
276
Specifies the retriever for which we will compute the top documents for. The retriever will produce `rank_window_size` results, which will later be merged based on the specified `weight` and `normalizer`.
273
277
274
278
`weight`
275
-
: (Optional, float)
279
+
: (Required, float)
276
280
277
281
The weight that each score of this retriever’s top docs will be multiplied with. Must be greater or equal to 0. Defaults to 1.0.
278
282
279
283
`normalizer`
280
-
: (Optional, String)
284
+
: (Required, String)
281
285
282
286
- Specifies how we will normalize the retriever’s scores, before applying the specified `weight`. Available values are: `minmax`, `l2_norm`, and `none`. Defaults to `none`.
283
287
@@ -293,7 +297,7 @@ Each entry specifies the following parameters:
293
297
See also [this hybrid search example](docs-content://solutions/search/retrievers-examples.md#retrievers-examples-linear-retriever) using a linear retriever on how to independently configure and apply normalizers to retrievers.
294
298
295
299
`rank_window_size`
296
-
: (Optional, integer)
300
+
: (Required, integer)
297
301
298
302
This value determines the size of the individual result sets per query. A higher value will improve result relevance at the cost of performance. The final ranked result set is pruned down to the search request’s [size](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search#search-size-param). `rank_window_size` must be greater than or equal to `size` and greater than or equal to `1`. Defaults to the `size` parameter.
299
303
@@ -303,6 +307,10 @@ See also [this hybrid search example](docs-content://solutions/search/retrievers
303
307
304
308
Applies the specified [boolean query filter](/reference/query-languages/query-dsl/query-dsl-bool-query.md) to all of the specified sub-retrievers, according to each retriever’s specifications.
305
309
310
+
`min_score`
311
+
: (Optional, `float`)
312
+
313
+
Minimum [`_score`](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) for matching documents. Documents with a lower `_score` are not included in the top documents.
306
314
307
315
308
316
## RRF Retriever [rrf-retriever]
@@ -335,7 +343,10 @@ An [RRF](/reference/elasticsearch/rest-apis/reciprocal-rank-fusion.md) retriever
335
343
336
344
Applies the specified [boolean query filter](/reference/query-languages/query-dsl/query-dsl-bool-query.md) to all of the specified sub-retrievers, according to each retriever’s specifications.
337
345
346
+
`min_score`
347
+
: (Optional, `float`)
338
348
349
+
Minimum [`_score`](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) for matching documents. Documents with a lower `_score` are not included in the top documents.
@@ -472,7 +483,10 @@ When using the `rescorer`, an error is returned if the following conditions are
472
483
473
484
Applies a [boolean query filter](/reference/query-languages/query-dsl/query-dsl-bool-query.md) to the retriever, ensuring that all documents match the filter criteria without affecting their scores.
474
485
486
+
`min_score`
487
+
: (Optional, `float`)
475
488
489
+
Minimum [`_score`](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) for matching documents. Documents with a lower `_score` are not included in the top documents.
The text snippet used as the basis for similarity comparison.
625
639
@@ -839,6 +853,16 @@ To use the `rule` retriever you must first create one or more query rulesets usi
839
853
840
854
The number of top documents to return from the `rule` retriever. Defaults to `10`.
841
855
856
+
`min_score`
857
+
: (Optional, `float`)
858
+
859
+
Sets a minimum threshold score forincluding documentsin the results. Documents with similarity scores below this threshold will be excluded.
860
+
861
+
862
+
`filter`
863
+
: (Optional, [query object or list of query objects](/reference/query-languages/querydsl.md))
864
+
865
+
Applies the specified [boolean query filter](/reference/query-languages/query-dsl/query-dsl-bool-query.md) to the child `retriever`. If the child retriever already specifies any filters, then this top-level filter is applied in conjuction with the filter defined in the child retriever.
@@ -945,10 +969,25 @@ A `pinned` retriever returns top documents by always placing specific documents
945
969
A list of objects specifying documents to pin. Each object must contain at least an `_id` field, and may also specify `_index`if pinning documents across multiple indices.
946
970
947
971
`retriever`
948
-
: (Optional, retriever object)
972
+
: (Required, retriever object)
949
973
950
974
A retriever (for example a `standard` retriever or a specialized retriever such as `rrf` retriever) used to retrieve the remaining documents after the pinned ones.
951
975
976
+
`rank_window_size`
977
+
: (Required, `int`)
978
+
979
+
The number of top documents to return from the `rule` retriever. Defaults to `10`.
980
+
981
+
`min_score`
982
+
: (Optional, `float`)
983
+
984
+
Sets a minimum threshold score forincluding documentsin the results. Documents with similarity scores below this threshold will be excluded.
985
+
986
+
`filter`
987
+
: (Optional, [query object or list of query objects](/reference/query-languages/querydsl.md))
988
+
989
+
Applies the specified [boolean query filter](/reference/query-languages/query-dsl/query-dsl-bool-query.md) to the child `retriever`. If the child retriever already specifies any filters, then this top-level filter is applied in conjuction with the filter defined in the child retriever.
990
+
952
991
Either `ids` or `docs` must be specified.
953
992
954
993
### Example using `docs` [pinned-retriever-example-documents]
0 commit comments