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: build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionDownloadPluginFuncTest.groovy
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -167,6 +167,11 @@ class InternalDistributionDownloadPluginFuncTest extends AbstractGradleFuncTest
Copy file name to clipboardExpand all lines: build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionArchiveSetupPlugin.java
Copy file name to clipboardExpand all lines: docs/reference/elasticsearch/rest-apis/retrievers/linear-retriever.md
+25-7Lines changed: 25 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,9 +31,16 @@ Combining `query` and `retrievers` is not supported.
31
31
`normalizer` {applies_to}`stack: ga 9.1`
32
32
: (Optional, String)
33
33
34
-
The normalizer to use when using the [multi-field query format](../retrievers.md#multi-field-query-format).
34
+
The top-level normalizer to use when combining results.
35
35
See [normalizers](#linear-retriever-normalizers) for supported values.
36
36
Required when `query` is specified.
37
+
38
+
When used with the [multi-field query format](../retrievers.md#multi-field-query-format) (`query` parameter), normalizes scores per [field grouping](../retrievers.md#multi-field-field-grouping).
39
+
Otherwise serves as the default normalizer for any sub-retriever that doesn't specify its own normalizer. Per-retriever normalizers always take precedence over the top-level normalizer.
40
+
41
+
:::{note}
42
+
**Top-level normalizer support for sub-retrievers**: The ability to use a top-level normalizer as a default for sub-retrievers was introduced in Elasticsearch 9.2+. In earlier versions, only per-retriever normalizers are supported.
43
+
:::
37
44
38
45
::::{warning}
39
46
Avoid using `none` as that will disable normalization and may bias the result set towards lexical matches.
@@ -74,9 +81,10 @@ Each entry in the `retrievers` array specifies the following parameters:
74
81
`normalizer`
75
82
: (Optional, String)
76
83
77
-
Specifies how the retriever’s score will be normalized before applying the specified `weight`.
84
+
Specifies how the retriever's score will be normalized before applying the specified `weight`.
78
85
See [normalizers](#linear-retriever-normalizers) for supported values.
79
-
Defaults to `none`.
86
+
If not specified, uses the top-level `normalizer` or defaults to `none` if no top-level normalizer is set.
87
+
{applies_to}`stack: ga 9.2`
80
88
81
89
See also [this hybrid search example](retrievers-examples.md#retrievers-examples-linear-retriever) using a linear retriever on how to independently configure and apply normalizers to retrievers.
82
90
@@ -94,7 +102,7 @@ The `linear` retriever supports the following normalizers:
94
102
95
103
## Example
96
104
97
-
This example of a hybrid search weights KNN results five times more heavily than BM25 results in the final ranking.
105
+
This example of a hybrid search weights KNN results five times more heavily than BM25 results in the final ranking, with a top-level normalizer applied to all retrievers.
98
106
99
107
```console
100
108
GET my_index/_search
@@ -105,23 +113,33 @@ GET my_index/_search
105
113
{
106
114
"retriever": {
107
115
"knn": {
108
-
...
116
+
"field": "title_vector",
117
+
"query_vector": [0.1, 0.2, 0.3],
118
+
"k": 10,
119
+
"num_candidates": 100
109
120
}
110
121
},
111
122
"weight": 5 # KNN query weighted 5x
112
123
},
113
124
{
114
125
"retriever": {
115
126
"standard": {
116
-
...
127
+
"query": {
128
+
"match": {
129
+
"title": "elasticsearch"
130
+
}
131
+
}
117
132
}
118
133
},
119
134
"weight": 1.5 # BM25 query weighted 1.5x
120
135
}
121
-
]
136
+
],
137
+
"normalizer": "minmax"
122
138
}
123
139
}
124
140
}
125
141
```
126
142
143
+
In this example, the `minmax` normalizer is applied to both the kNN retriever and the standard 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.
144
+
127
145
See also [this hybrid search example](retrievers-examples.md#retrievers-examples-linear-retriever).
Copy file name to clipboardExpand all lines: docs/reference/elasticsearch/rest-apis/searching-with-query-rules.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,16 +16,21 @@ $$$query-rules$$$
16
16
* Personalized metadata about users (e.g. country, language, etc)
17
17
* A particular topic
18
18
* A referring site
19
-
* etc.
19
+
20
20
21
21
Query rules define a metadata key that will be used to match the metadata provided in the [rule retriever](/reference/elasticsearch/rest-apis/retrievers/rule-retriever.md) with the criteria specified in the rule.
22
22
23
23
When a query rule matches the rule metadata according to its defined criteria, the query rule action is applied to the underlying `organic` query.
24
24
25
25
For example, a query rule could be defined to match a user-entered query string of `pugs` and a country `us` and promote adoptable shelter dogs if the rule query met both criteria.
26
26
27
-
Rules are defined using the [query rules API](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-query_rules) and searched using the [rule retriever](/reference/elasticsearch/rest-apis/retrievers/rule-retriever.md) or the [rule query](/reference/query-languages/query-dsl/query-dsl-rule-query.md).
27
+
You can create and manage query rules using either:
@@ -68,7 +73,7 @@ The actions to take when the rule matches a query:
68
73
Use `ids` when searching over a single index, and `docs` when searching over multiple indices. `ids` and `docs` cannot be combined in the same query.
69
74
70
75
71
-
## Add query rules [add-query-rules]
76
+
## Manage query rules [manage-query-rules]
72
77
73
78
You can add query rules using the [Create or update query ruleset](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-put-ruleset) call. This adds a ruleset containing one or more query rules that will be applied to queries that match their specified criteria.
74
79
@@ -145,6 +150,8 @@ There is a limit of 100 rules per ruleset. This can be increased up to 1000 usin
145
150
146
151
You can use the [Get query ruleset](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-get-ruleset) call to retrieve the ruleset you just created, the [List query rulesets](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-list-rulesets) call to retrieve a summary of all query rulesets, and the [Delete query ruleset](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-delete-ruleset) call to delete a query ruleset.
147
152
153
+
To manage rules using the Query Rules UI, refer to [Manage query rules](https://www.elastic.co/docs/solutions/search/query-rules-ui#manage-existing-rules).
0 commit comments