Skip to content

Commit ee464fe

Browse files
committed
Clarify javadoc
1 parent a579ff5 commit ee464fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@
3333
/**
3434
* A query that matches the provided docs with their scores.
3535
*
36-
* Note: this query was adapted from Lucene's DocAndScoreQuery from the class
36+
* Note: this query was originally adapted from Lucene's DocAndScoreQuery from the class
3737
* {@link org.apache.lucene.search.KnnFloatVectorQuery}, which is package-private.
38-
* There are no changes to the behavior, just some renames.
3938
*/
4039
public class KnnScoreDocQuery extends Query {
4140
private final int[] docs;
@@ -56,6 +55,7 @@ public class KnnScoreDocQuery extends Query {
5655
* @param reader IndexReader
5756
*/
5857
KnnScoreDocQuery(ScoreDoc[] scoreDocs, IndexReader reader) {
58+
// Ensure that the docs are sorted by docId, as they are later searched using binary search
5959
Arrays.sort(scoreDocs, Comparator.comparingInt(scoreDoc -> scoreDoc.doc));
6060
this.docs = new int[scoreDocs.length];
6161
this.scores = new float[scoreDocs.length];

0 commit comments

Comments
 (0)