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/search/search-your-data/retrievers-overview.asciidoc
+5-35Lines changed: 5 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ Applies <<query-rules,query rules>> to the query before returning results.
36
36
Used for <<semantic-reranking,semantic reranking>>.
37
37
Requires first creating a `rerank` task using the <<put-inference-api,{es} Inference API>>.
38
38
* <<pinned-retriever,*Pinned Retriever*>>.
39
-
Returns top documents by always placing specific documents at the top of the results, in the order provided. Useful for promoting certain documents for particular queries, regardless of their relevance score. The remaining results are filled by a fallback retriever.
39
+
Returns top documents by always placing specific documents at the top of the results, with the remaining hits provided by a secondary retriever.
40
40
41
41
[discrete]
42
42
[[retrievers-overview-why-are-they-useful]]
@@ -149,12 +149,6 @@ GET example-index/_search
149
149
}
150
150
----
151
151
//NOTCONSOLE
152
-
==============
153
-
154
-
[[pinned-retriever]]
155
-
=== Pinned Retriever
156
-
157
-
A `pinned` retriever returns top documents by always placing specific documents at the top of the results, in the order provided. This is useful for promoting certain documents for particular queries, regardless of their relevance score. The remaining results are filled by a fallback retriever.
158
152
159
153
[discrete]
160
154
[[pinned-retriever-parameters]]
@@ -170,38 +164,13 @@ A list of document IDs to pin at the top of the results, in the order provided.
170
164
+
171
165
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.
172
166
173
-
`fallback`::
167
+
`retriever`::
174
168
(Optional, retriever object)
175
169
+
176
-
A retriever to use for retrieving the remaining documents after the pinned ones.
170
+
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.
177
171
178
172
Either `ids` or `documents` must be specified.
179
173
180
-
[discrete]
181
-
[[pinned-retriever-example-ids]]
182
-
==== Example using `ids`
183
-
184
-
[source,console]
185
-
----
186
-
GET /restaurants/_search
187
-
{
188
-
"retriever": {
189
-
"pinned": {
190
-
"ids": ["doc1", "doc2"],
191
-
"fallback": {
192
-
"standard": {
193
-
"query": {
194
-
"match": {
195
-
"title": "elasticsearch"
196
-
}
197
-
}
198
-
}
199
-
}
200
-
}
201
-
}
202
-
}
203
-
----
204
-
205
174
[discrete]
206
175
[[pinned-retriever-example-documents]]
207
176
==== Example using `documents`
@@ -216,7 +185,7 @@ GET /restaurants/_search
216
185
{ "_id": "doc1", "_index": "my-index" },
217
186
{ "_id": "doc2" }
218
187
],
219
-
"fallback": {
188
+
"retriever": {
220
189
"standard": {
221
190
"query": {
222
191
"match": {
@@ -229,6 +198,7 @@ GET /restaurants/_search
229
198
}
230
199
}
231
200
----
201
+
//NOTCONSOLE
232
202
233
203
For more examples on how to use retrievers, please refer to <<retrievers-examples,retriever examples>>.
0 commit comments