Skip to content

Commit 7824f5c

Browse files
Updating field type and adding missing field params for Retrievers
1 parent aaee222 commit 7824f5c

File tree

1 file changed

+46
-7
lines changed

1 file changed

+46
-7
lines changed

docs/reference/elasticsearch/rest-apis/retrievers.md

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ A kNN retriever returns top documents from a [k-nearest neighbor search (kNN)](d
199199

200200
Read more here: [knn similarity search](docs-content://solutions/search/vector/knn.md#knn-similarity-search)
201201

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.
202206

203207
`rescore_vector`
204208
: (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
259263
#### Parameters [linear-retriever-parameters]
260264

261265
`retrievers`
262-
: (Required, array of objects)
266+
: (Optional, array of objects)
263267

264268
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.
265269

@@ -272,12 +276,12 @@ Each entry specifies the following parameters:
272276
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`.
273277

274278
`weight`
275-
: (Optional, float)
279+
: (Required, float)
276280

277281
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.
278282

279283
`normalizer`
280-
: (Optional, String)
284+
: (Required, String)
281285

282286
- 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`.
283287

@@ -293,7 +297,7 @@ Each entry specifies the following parameters:
293297
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.
294298

295299
`rank_window_size`
296-
: (Optional, integer)
300+
: (Required, integer)
297301

298302
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.
299303

@@ -303,6 +307,10 @@ See also [this hybrid search example](docs-content://solutions/search/retrievers
303307

304308
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.
305309

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.
306314

307315

308316
## RRF Retriever [rrf-retriever]
@@ -335,7 +343,10 @@ An [RRF](/reference/elasticsearch/rest-apis/reciprocal-rank-fusion.md) retriever
335343

336344
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.
337345

346+
`min_score`
347+
: (Optional, `float`)
338348

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.
339350

340351
### Example: Hybrid search [rrf-retriever-example-hybrid]
341352

@@ -472,7 +483,10 @@ When using the `rescorer`, an error is returned if the following conditions are
472483

473484
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.
474485

486+
`min_score`
487+
: (Optional, `float`)
475488

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.
476490

477491
### Example [rescorer-retriever-example]
478492

@@ -607,7 +621,7 @@ score = ln(score), if score < 0
607621

608622

609623
`field`
610-
: (Required, `string`)
624+
: (Optional, `string`)
611625

612626
The document field to be used for text similarity comparisons. This field should contain the text that will be evaluated against the `inferenceText`.
613627

@@ -619,7 +633,7 @@ score = ln(score), if score < 0
619633

620634

621635
`inference_text`
622-
: (Required, `string`)
636+
: (Optional, `string`)
623637

624638
The text snippet used as the basis for similarity comparison.
625639

@@ -839,6 +853,16 @@ To use the `rule` retriever you must first create one or more query rulesets usi
839853

840854
The number of top documents to return from the `rule` retriever. Defaults to `10`.
841855

856+
`min_score`
857+
: (Optional, `float`)
858+
859+
Sets a minimum threshold score for including documents in 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.
842866

843867

844868
### Example: Rule retriever [rule-retriever-example]
@@ -945,10 +969,25 @@ A `pinned` retriever returns top documents by always placing specific documents
945969
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.
946970

947971
`retriever`
948-
: (Optional, retriever object)
972+
: (Required, retriever object)
949973

950974
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.
951975

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 for including documents in 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+
952991
Either `ids` or `docs` must be specified.
953992

954993
### Example using `docs` [pinned-retriever-example-documents]

0 commit comments

Comments
 (0)