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: x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/retriever/PinnedRetrieverBuilder.java
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -160,12 +160,12 @@ public int rankWindowSize() {
160
160
* Prioritizes docs over ids if both are present.
161
161
*
162
162
* @param baseQuery the base query to pin documents to
163
-
* @return a PinnedQueryBuilder or the original query if no pinned documents
163
+
* @return a PinnedQueryBuilder
164
+
* @throws IllegalArgumentException if baseQuery is null
Copy file name to clipboardExpand all lines: x-pack/plugin/search-business-rules/src/test/java/org/elasticsearch/xpack/searchbusinessrules/retriever/PinnedRetrieverBuilderTests.java
Copy file name to clipboardExpand all lines: x-pack/plugin/search-business-rules/src/yamlRestTest/resources/rest-api-spec/test/search-business-rules/10_pinned_retriever.yml
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -333,11 +333,15 @@ setup:
333
333
- gt: { hits.hits.0._score: 1.0 }
334
334
- match:
335
335
hits.hits.0._explanation.description: "Pinned document by ids, original explanation:"
336
+
- match:
337
+
hits.hits.0._explanation.details.0.description: "doc [0] with an original score of [1.7014124E38] is at rank [1] from the following source queries."
336
338
337
339
- match: { hits.hits.1._id: doc2 }
338
340
- gt: { hits.hits.1._score: 1.0 }
339
341
- match:
340
342
hits.hits.1._explanation.description: "Pinned document by ids, original explanation:"
343
+
- match:
344
+
hits.hits.1._explanation.details.0.description: "doc [1] with an original score of [1.7014122E38] is at rank [2] from the following source queries."
341
345
342
346
---
343
347
"pinned retriever with empty parameters":
@@ -439,3 +443,16 @@ setup:
439
443
query:
440
444
match: { text: "document" }
441
445
sort: [ { "_id": "desc" } ]
446
+
447
+
---
448
+
"pinned retriever error case - null inner query":
449
+
- do:
450
+
catch: /Underlying query cannot be null for pinned retriever/
0 commit comments