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
+27-33Lines changed: 27 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ A standard retriever returns top documents from a traditional [query](/reference
60
60
`filter`
61
61
: (Optional, [query object or list of query objects](/reference/query-languages/querydsl.md))
62
62
63
-
Applies a [boolean query filter](/reference/query-languages/query-dsl-bool-query.md) to this retriever, where all documents must match this query but do not contribute to the score.
63
+
Applies a [boolean query filter](/reference/query-languages/query-dsl/query-dsl-bool-query.md) to this retriever, where all documents must match this query but do not contribute to the score.
64
64
65
65
66
66
`search_after`
@@ -84,7 +84,7 @@ A standard retriever returns top documents from a traditional [query](/reference
84
84
`min_score`
85
85
: (Optional, `float`)
86
86
87
-
Minimum [`_score`](/reference/query-languages/query-filter-context.md#relevance-scores) for matching documents. Documents with a lower `_score` are not included in the top documents.
87
+
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.
88
88
89
89
90
90
`collapse`
@@ -271,12 +271,12 @@ Each entry specifies the following parameters:
271
271
`weight`
272
272
: (Optional, float)
273
273
274
-
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.
274
+
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.
275
275
276
276
`normalizer`
277
277
: (Optional, String)
278
278
279
-
Specifies how we will normalize the retriever's scores, before applying the specified `weight`. Available values are: `minmax`, and `none`. Defaults to `none`.
279
+
Specifies how we will normalize the retriever’s scores, before applying the specified `weight`. Available values are: `minmax`, and `none`. Defaults to `none`.
280
280
281
281
* `none`
282
282
* `minmax` : A `MinMaxScoreNormalizer` that normalizes scores based on the following formula
@@ -291,24 +291,17 @@ See also [this hybrid search example](docs-content://solutions/search/retrievers
291
291
`rank_window_size`
292
292
: (Optional, integer)
293
293
294
-
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.
295
-
294
+
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.
296
295
297
296
`min_score`
298
297
: (Optional, float)
299
298
300
-
Minimum score threshold for documents to be included in the final result set. Documents with scores below this threshold will be filtered out. Must be greater than or equal to 0. Defaults to 0.
301
-
299
+
Minimum score threshold for documents to be included in the final result set. Documents with scores below this threshold will be filtered out. Must be greater than or equal to 0 if explicitly set. If not set, defaults to minimum float value, meaning no documents are filtered based on score .
302
300
303
301
`filter`
304
302
: (Optional, [query object or list of query objects](/reference/query-languages/querydsl.md))
305
303
306
-
Applies the specified [boolean query filter](/reference/query-languages/query-dsl-bool-query.md) to all of the specified sub-retrievers, according to each retriever's specifications.
307
-
308
-
309
-
### Example: Hybrid search with min_score [linear-retriever-example]
310
-
311
-
This example demonstrates how to use the Linear retriever to combine a standard retriever with a kNN retriever, applying weights, normalization, and a minimum score threshold:
304
+
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.
312
305
313
306
```console
314
307
GET /restaurants/_search
@@ -353,23 +346,24 @@ GET /restaurants/_search
353
346
}
354
347
```
355
348
356
-
1. Defines a retriever tree with a Linear retriever.
357
-
2. The sub-retrievers array.
358
-
3.The first sub-retriever is a `standard` retriever.
359
-
4.The weight applied to the scores from the standard retriever (2.0).
360
-
5.The normalization method applied to the standard retriever's scores.
361
-
6.The second sub-retriever is a `knn` retriever.
362
-
7.The weight applied to the scores from the kNN retriever (1.0).
363
-
8.The normalization method applied to the kNN retriever's scores.
364
-
9. The rank window size for the Linear retriever.
365
-
10.The minimum score threshold - documents with a combined score below 1.5 will be filtered out from the final result set.
349
+
1. Defines a retriever tree using the `linear` retriever type.
350
+
2. The array of retrievers to be combined.
351
+
3.A `standard`retriever used for traditional full-text search.
352
+
4.Weight applied to the score from the `standard` retriever.
353
+
5.Normalization method (`minmax`) applied to the `standard` retriever score.
354
+
6.A `knn`retriever used for vector-based similarity search.
355
+
7.Weight applied to the score from the `knn` retriever.
356
+
8.Normalization method (`minmax`) applied to the `knn` retriever score.
357
+
9. The number of top documents considered for scoring in the linear combination.
358
+
10.Minimum score threshold for the final result set — documents below this combined score will be excluded.
366
359
367
360
368
361
## RRF Retriever [rrf-retriever]
369
362
370
363
An [RRF](/reference/elasticsearch/rest-apis/reciprocal-rank-fusion.md) retriever returns top documents based on the RRF formula, equally weighting two or more child retrievers. Reciprocal rank fusion (RRF) is a method for combining multiple result sets with different relevance indicators into a single result set.
371
364
372
365
366
+
373
367
#### Parameters [rrf-retriever-parameters]
374
368
375
369
`retrievers`
@@ -387,13 +381,13 @@ An [RRF](/reference/elasticsearch/rest-apis/reciprocal-rank-fusion.md) retriever
387
381
`rank_window_size`
388
382
: (Optional, integer)
389
383
390
-
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.
384
+
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.
391
385
392
386
393
387
`filter`
394
388
: (Optional, [query object or list of query objects](/reference/query-languages/querydsl.md))
395
389
396
-
Applies the specified [boolean query filter](/reference/query-languages/query-dsl-bool-query.md) to all of the specified sub-retrievers, according to each retriever's specifications.
390
+
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.
397
391
398
392
399
393
@@ -502,12 +496,12 @@ For compound retrievers like `rrf`, the `window_size` parameter defines the tota
502
496
503
497
When using the `rescorer`, an error is returned if the following conditions are not met:
504
498
505
-
* The minimum configured rescore's `window_size` is:
499
+
* The minimum configured rescore’s `window_size` is:
506
500
507
501
* Greater than or equal to the `size` of the parent retriever for nested `rescorer` setups.
508
502
* Greater than or equal to the `size` of the search request when used as the primary retriever in the tree.
509
503
510
-
* And the maximum rescore's `window_size` is:
504
+
* And the maximum rescore’s `window_size` is:
511
505
512
506
* Smaller than or equal to the `size` or `rank_window_size` of the child retriever.
513
507
@@ -530,7 +524,7 @@ When using the `rescorer`, an error is returned if the following conditions are
530
524
`filter`
531
525
: (Optional. [query object or list of query objects](/reference/query-languages/querydsl.md))
532
526
533
-
Applies a [boolean query filter](/reference/query-languages/query-dsl-bool-query.md) to the retriever, ensuring that all documents match the filter criteria without affecting their scores.
527
+
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.
: (Optional, [query object or list of query objects](/reference/query-languages/querydsl.md))
701
695
702
-
Applies the specified [boolean query filter](/reference/query-languages/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.
696
+
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.
703
697
704
698
705
699
@@ -733,7 +727,7 @@ Follow these steps:
733
727
}
734
728
```
735
729
736
-
1. [Adaptive allocations](docs-content://explore-analyze/machine-learning/nlp/ml-nlp-auto-scale.md#nlp-model-adaptive-allocations) will be enabled with the minimum of 1 and the maximum of 10 allocations.
730
+
1. [Adaptive allocations](docs-content://deploy-manage/autoscaling/trained-model-autoscaling.md#enabling-autoscaling-through-apis-adaptive-allocations) will be enabled with the minimum of 1 and the maximum of 10 allocations.
737
731
738
732
2. Define a `text_similarity_rerank` retriever:
739
733
@@ -867,7 +861,7 @@ Follow these steps to load the model and create a semantic re-ranker.
867
861
868
862
## Query Rules Retriever [rule-retriever]
869
863
870
-
The `rule` retriever enables fine-grained control over search results by applying contextual [query rules](/reference/elasticsearch/rest-apis/searching-with-query-rules.md#query-rules) to pin or exclude documents for specific queries. This retriever has similar functionality to the [rule query](/reference/query-languages/query-dsl-rule-query.md), but works out of the box with other retrievers.
864
+
The `rule` retriever enables fine-grained control over search results by applying contextual [query rules](/reference/elasticsearch/rest-apis/searching-with-query-rules.md#query-rules) to pin or exclude documents for specific queries. This retriever has similar functionality to the [rule query](/reference/query-languages/query-dsl/query-dsl-rule-query.md), but works out of the box with other retrievers.
871
865
872
866
### Prerequisites [_prerequisites_16]
873
867
@@ -996,7 +990,7 @@ The [`from`](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operati
996
990
997
991
### Using aggregations with a retriever tree [retriever-aggregations]
998
992
999
-
[Aggregations](/reference/data-analysis/aggregations/index.md) are globally specified as part of a search request. The query used foran aggregation is the combination of all leaf retrievers as `should` clausesin a [boolean query](/reference/query-languages/query-dsl-bool-query.md).
993
+
[Aggregations](/reference/aggregations/index.md) are globally specified as part of a search request. The query used foran aggregation is the combination of all leaf retrievers as `should` clausesin a [boolean query](/reference/query-languages/query-dsl/query-dsl-bool-query.md).
1000
994
1001
995
1002
996
### Restrictions on search parameters when specifying a retriever [retriever-restrictions]
Copy file name to clipboardExpand all lines: x-pack/plugin/rank-rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/linear/LinearRetrieverIT.java
+8-9Lines changed: 8 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -913,13 +913,9 @@ public void testLinearWithMinScore() {
0 commit comments