Skip to content

Commit 2f41434

Browse files
authored
Merge branch 'main' into cps-transform-6
2 parents fa2ed97 + b7e679f commit 2f41434

File tree

3 files changed

+35
-40
lines changed

3 files changed

+35
-40
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,6 @@ tests:
401401
- class: org.elasticsearch.xpack.esql.parser.promql.PromqlParserTests
402402
method: testInstantVectorExpected
403403
issue: https://github.com/elastic/elasticsearch/issues/142420
404-
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
405-
method: test {yaml=search.retrievers/result-diversification/10_mmr_result_diversification_retriever/Test MMR result diversification multiple indexes}
406-
issue: https://github.com/elastic/elasticsearch/issues/142422
407404
- class: org.elasticsearch.indices.stats.IndexStatsIT
408405
method: testFieldDataStats
409406
issue: https://github.com/elastic/elasticsearch/issues/142424

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.retrievers/result-diversification/10_mmr_result_diversification_retriever.yml

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -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":

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/lucene/LuceneTopNSourceOperatorCollectorTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ private LuceneTopNSourceOperator.Factory createFactory(boolean needsScore, List<
319319
new IndexedByShardIdFromSingleton<>(ctx),
320320
queryFunction,
321321
partitioning,
322-
LuceneSourceOperator.Factory::autoStrategy,
323322
randomIntBetween(1, 10),
324323
10000,
325324
randomIntBetween(10, 100),

0 commit comments

Comments
 (0)