@@ -118,22 +118,22 @@ setup:
118118 index : test-result-diversification-index-other
119119 refresh : true
120120 body : |
121- {"index":{} }
122- {"id": 12, "textbody": "first text other", "textvector": [0.4 , 0.2 , 0.4 , 0.4 ], "keywordfield": "test1"}
123- {"index":{} }
124- {"id": 23, "textbody": "second text other", "textvector": [0.4 , 0.2 , 0.3 , 0.3 ], "keywordfield": "test2"}
125- {"index":{} }
126- {"id": 14, "textbody": "second text duplicate other", "textvector": [0.4 , 0.2 , 0.3 , 0.3 ], "keywordfield": "test2_dup"}
127- {"index":{} }
128- {"id": 15, "textbody": "third text other", "textvector": [0.4 , 0.1 , 0.3 , 0.3 ], "keywordfield": "test3"}
129- {"index":{} }
130- {"id": 16, "textbody": "third text duplicate other", "textvector": [0.4 , 0.1 , 0.3 , 0.3 ], "keywordfield": "test3_dup"}
131- {"index":{} }
132- {"id": 17, "textbody": "fourth text other", "textvector": [0.1 , 0.9 , 0.5 , 0.9 ], "keywordfield": "test4"}
133- {"index":{} }
134- {"id": 18, "textbody": "fifth text other", "textvector": [0.1 , 0.9 , 0.5 , 0.9 ], "keywordfield": "test5"}
135- {"index":{} }
136- {"id": 19, "textbody": "sixth text other", "textvector": [0.05 , 0.05 , 0.05 , 0.05 ], "keywordfield": "test6"}
121+ { "index": { } }
122+ { "id": 12, "textbody": "first text other", "textvector": [ 0.14 , 0.5 , 0.49 , 0.36 ], "keywordfield": "test1" }
123+ { "index": { } }
124+ { "id": 23, "textbody": "second text other", "textvector": [ 0.63 , 0.63 , 0.51 , 0.07 ], "keywordfield": "test2" }
125+ { "index": { } }
126+ { "id": 14, "textbody": "second text duplicate other", "textvector": [ 0.63 , 0.63 , 0.51 , 0.07 ], "keywordfield": "test2_dup" }
127+ { "index": { } }
128+ { "id": 15, "textbody": "third text other", "textvector": [ 0.3 , 0.24 , 0.97 , 0.82 ], "keywordfield": "test3" }
129+ { "index": { } }
130+ { "id": 16, "textbody": "third text duplicate other", "textvector": [ 0.3 , 0.24 , 0.97 , 0.82 ], "keywordfield": "test3_dup" }
131+ { "index": { } }
132+ { "id": 17, "textbody": "fourth text other", "textvector": [ 0.88 , 0.82 , 0.96 , 0.06 ], "keywordfield": "test4" }
133+ { "index": { } }
134+ { "id": 18, "textbody": "fifth text other", "textvector": [ 0.36 , 0.03 , 0.1 , 0.62 ], "keywordfield": "test5" }
135+ { "index": { } }
136+ { "id": 19, "textbody": "sixth text other", "textvector": [ 0.19 , 0.44 , 0.68 , 0.35 ], "keywordfield": "test6" }
137137
138138 - do :
139139 headers :
@@ -442,25 +442,24 @@ teardown:
442442 index : " test-result-diversification-index*"
443443 body :
444444 retriever :
445- standard :
446- query :
447- match_all : { }
448- sort :
449- id :
450- order : asc
445+ knn :
446+ field : " textvector"
447+ query_vector : [ 0.5, 0.2, 0.4, 0.4 ]
448+ k : 10
449+ num_candidates : 10
451450
452- - match : { hits.total.value: 19 }
451+ - match : { hits.total.value: 10 }
453452 - length : { hits.hits: 10 }
454- - match : { hits.hits.0._source.textbody: "first text" }
455- - match : { hits.hits.1._source.textbody: "second text" }
456- - match : { hits.hits.2._source.textbody: "second text duplicate " }
457- - match : { hits.hits.3._source.textbody: "third text" }
458- - match : { hits.hits.4._source.textbody: "third text duplicate " }
459- - match : { hits.hits.5._source.textbody: "fourth text" }
460- - match : { hits.hits.6._source.textbody: "fifth text" }
461- - match : { hits.hits.7._source.textbody: "sixth text" }
462- - match : { hits.hits.8._source.textbody: "seventh text" }
463- - match : { hits.hits.9._source.textbody: "eighth text" }
453+ - match : { hits.hits.0._source.textbody: "second text" }
454+ - match : { hits.hits.1._source.textbody: "second text duplicate " }
455+ - match : { hits.hits.2._source.textbody: "third text" }
456+ - match : { hits.hits.3._source.textbody: "third text duplicate " }
457+ - match : { hits.hits.4._source.textbody: "first text" }
458+ - match : { hits.hits.5._source.textbody: "sixth text" }
459+ - match : { hits.hits.6._source.textbody: "ninth text" }
460+ - match : { hits.hits.7._source.textbody: "third text other " }
461+ - match : { hits.hits.8._source.textbody: "third text duplicate other " }
462+ - match : { hits.hits.9._source.textbody: "fifth text other " }
464463
465464 - do :
466465 search :
@@ -481,9 +480,9 @@ teardown:
481480
482481 - match : { hits.total.value: 10 }
483482 - length : { hits.hits: 3 }
484- - match : { hits.hits.0._source.textbody: "second text other " }
485- - match : { hits.hits.1._source.textbody: "third text other " }
486- - match : { hits.hits.2._source.textbody: "third text duplicate other " }
483+ - match : { hits.hits.0._source.textbody: "second text" }
484+ - match : { hits.hits.1._source.textbody: "sixth text" }
485+ - match : { hits.hits.2._source.textbody: "ninth text" }
487486
488487---
489488" Test MMR result diversification with default size should return results " :
0 commit comments