Skip to content

Commit 29d16a2

Browse files
committed
added extra test case
1 parent 1a68442 commit 29d16a2

File tree

1 file changed

+66
-3
lines changed
  • x-pack/plugin/search-business-rules/src/yamlRestTest/resources/rest-api-spec/test/search-business-rules

1 file changed

+66
-3
lines changed

x-pack/plugin/search-business-rules/src/yamlRestTest/resources/rest-api-spec/test/search-business-rules/10_pinned_retriever.yml

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ setup:
55
- do:
66
indices.create:
77
index: test-index1
8+
- do:
9+
indices.create:
10+
index: test-index2
811

912
- do:
1013
bulk:
@@ -26,6 +29,17 @@ setup:
2629
- index:
2730
_id: doc5
2831
- { "text": "document five" }
32+
- do:
33+
bulk:
34+
refresh: true
35+
index: test-index2
36+
body:
37+
- index:
38+
_id: idx2-docA
39+
- { "text": "index two document A" }
40+
- index:
41+
_id: idx2-docB
42+
- { "text": "index two document B" }
2943

3044
---
3145
"pinned retriever parameter variations":
@@ -442,7 +456,56 @@ setup:
442456
- match: { hits.hits.2._score < 100.0 }
443457
- match: { hits.hits.3._id: doc4 }
444458
- match: { hits.hits.4._id: doc5 }
445-
446-
447-
448459

460+
---
461+
"pinned retriever multi-index vs single-index filtering":
462+
- skip: { features: headers }
463+
464+
- do:
465+
headers: { Content-Type: application/json }
466+
search:
467+
index: test-index1,test-index2
468+
body:
469+
retriever:
470+
pinned:
471+
ids: ["doc1", "idx2-docA"]
472+
retriever:
473+
standard:
474+
query:
475+
match: { text: "document" }
476+
477+
- match: { hits.total.value: 7 }
478+
- length: { hits.hits: 7 }
479+
- match: { hits.hits.0._id: doc1 }
480+
- match: { hits.hits.1._id: idx2-docA }
481+
- match: { hits.hits.2._id: idx2-docB }
482+
- match: { hits.hits.3._id: doc2 }
483+
- match: { hits.hits.4._id: doc3 }
484+
- match: { hits.hits.5._id: doc4 }
485+
- match: { hits.hits.6._id: doc5 }
486+
487+
- do:
488+
headers: { Content-Type: application/json }
489+
search:
490+
index: test-index1
491+
body:
492+
retriever:
493+
pinned:
494+
ids: ["doc1", "idx2-docA"]
495+
retriever:
496+
standard:
497+
query:
498+
match: { text: "document" }
499+
500+
- match: { hits.total.value: 5 }
501+
- length: { hits.hits: 5 }
502+
- match: { hits.hits.0._id: doc1 }
503+
- match: { hits.hits.0._score: 1.7014124E38 }
504+
- match: { hits.hits.1._id: doc2 }
505+
- match: { hits.hits.2._id: doc3 }
506+
- match: { hits.hits.3._id: doc4 }
507+
- match: { hits.hits.4._id: doc5 }
508+
509+
510+
511+

0 commit comments

Comments
 (0)