-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Linear retriever top level option for normalizer #129693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 45 commits
78fa6af
d4b1ced
83763e9
7066b10
d8de361
36c1a13
3b87c15
e3326e2
d36ada2
330e32b
c35a28e
b3d7f5f
8ac90e6
0309a65
299a222
cdef674
b6d5109
0872925
ff65d27
3d605ee
3ec7110
2a571ec
7808fc1
a44cf1d
89edd4f
08f68ab
c13f614
182afee
2ab7912
1cf1871
e087362
c36772f
a964d08
47d2086
9c7539b
22e51aa
b03d586
a670936
f3659cb
f6a8d4c
a8e1d5f
04f715b
a8235c4
7625b9d
19d8ce5
3d6b32b
976d9e8
5c0f006
2b2ee94
2e569d7
29c4f24
078515c
34e14f7
fdb0f88
f6484e1
d399593
45e2f7e
d7c6dbd
adc7ad2
acc4614
7ae5800
e6f9921
bd0d4ce
2bc12ec
e27722f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 129693 | ||
| summary: Add top level normalizer for linear retriever | ||
| area: Search | ||
| type: enhancement | ||
| issues: [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,8 @@ Combining `query` and `retrievers` is not supported. | |
| See [normalizers](#linear-retriever-normalizers) for supported values. | ||
| Required when `query` is specified. | ||
|
|
||
| When used with `retrievers`, the top-level `normalizer` serves as a default for any sub-retriever that doesn't specify its own normalizer. Per-retriever normalizers always take precedence over the top-level normalizer when both are specified. | ||
|
|
||
| ::::{warning} | ||
| Avoid using `none` as that will disable normalization and may bias the result set towards lexical matches. | ||
| See [field grouping](../retrievers.md#multi-field-field-grouping) for more information. | ||
|
|
@@ -124,4 +126,46 @@ GET my_index/_search | |
| } | ||
| ``` | ||
|
|
||
| ### Using top-level normalizer | ||
|
|
||
| This example shows how to use a top-level normalizer that applies to all sub-retrievers: | ||
|
|
||
| ```console | ||
| GET my_index/_search | ||
| { | ||
| "retriever": { | ||
| "linear": { | ||
| "retrievers": [ | ||
| { | ||
| "retriever": { | ||
| "standard": { | ||
| "query": { | ||
| "match": { | ||
| "title": "elasticsearch" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "weight": 1.0 | ||
| }, | ||
| { | ||
| "retriever": { | ||
| "knn": { | ||
| "field": "title_vector", | ||
| "query_vector": [0.1, 0.2, 0.3], | ||
| "k": 10, | ||
| "num_candidates": 100 | ||
| } | ||
| }, | ||
| "weight": 2.0 | ||
| } | ||
| ], | ||
| "normalizer": "minmax" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| In this example, the `minmax` normalizer is applied to both the standard retriever and the kNN retriever. The top-level normalizer serves as a default that can be overridden by individual sub-retrievers. When using the multi-field query format, the top-level normalizer is applied to all generated inner retrievers. | ||
|
||
|
|
||
| See also [this hybrid search example](retrievers-examples.md#retrievers-examples-linear-retriever). | ||
Uh oh!
There was an error while loading. Please reload this page.