Skip to content

Commit 7ba289f

Browse files
Merge branch 'main' into sa-fix-internal-cluster-tests
2 parents f677c7b + d1b2eb6 commit 7ba289f

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

docs/changelog/122653.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 122653
2+
summary: Knn vector rescoring to sort score docs
3+
area: Vector Search
4+
type: bug
5+
issues:
6+
- 119711

muted-tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,6 @@ tests:
150150
issue: https://github.com/elastic/elasticsearch/issues/117740
151151
- class: org.elasticsearch.xpack.security.authc.ldap.MultiGroupMappingIT
152152
issue: https://github.com/elastic/elasticsearch/issues/119599
153-
- class: org.elasticsearch.search.profile.dfs.DfsProfilerIT
154-
method: testProfileDfs
155-
issue: https://github.com/elastic/elasticsearch/issues/119711
156153
- class: org.elasticsearch.multi_cluster.MultiClusterYamlTestSuiteIT
157154
issue: https://github.com/elastic/elasticsearch/issues/119983
158155
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
@@ -347,6 +344,11 @@ tests:
347344
issue: https://github.com/elastic/elasticsearch/issues/122566
348345
- class: org.elasticsearch.entitlement.qa.EntitlementsDeniedNonModularIT
349346
issue: https://github.com/elastic/elasticsearch/issues/122569
347+
- class: org.elasticsearch.entitlement.qa.EntitlementsAllowedIT
348+
issue: https://github.com/elastic/elasticsearch/issues/122680
349+
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
350+
method: test {yaml=reference/snapshot-restore/apis/get-snapshot-api/line_408}
351+
issue: https://github.com/elastic/elasticsearch/issues/122681
350352

351353
# Examples:
352354
#

server/src/main/java/org/elasticsearch/search/vectors/RescoreKnnVectorQuery.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import java.io.IOException;
2525
import java.util.Arrays;
26+
import java.util.Comparator;
2627
import java.util.Objects;
2728

2829
/**
@@ -60,6 +61,7 @@ public Query rewrite(IndexSearcher searcher) throws IOException {
6061
TopDocs topDocs = searcher.search(query, k);
6162
vectorOperations = topDocs.totalHits.value();
6263
ScoreDoc[] scoreDocs = topDocs.scoreDocs;
64+
Arrays.sort(scoreDocs, Comparator.comparingInt(scoreDoc -> scoreDoc.doc));
6365
int[] docIds = new int[scoreDocs.length];
6466
float[] scores = new float[scoreDocs.length];
6567
for (int i = 0; i < scoreDocs.length; i++) {

0 commit comments

Comments
 (0)