mirror of https://github.com/apache/lucene.git
GITHUB-12181: fix false-positive TestKnnFloatVectorQuery.testDocAndScoreQueryBasics() failure (#12182)
This commit is contained in:
parent
e0d92eef98
commit
3bd06b1cb9
|
@ -201,11 +201,12 @@ public class TestKnnFloatVectorQuery extends BaseKnnVectorQueryTestCase {
|
|||
scores[i] = scoreDocs[i].score;
|
||||
maxScore = Math.max(maxScore, scores[i]);
|
||||
}
|
||||
int[] segments = AbstractKnnVectorQuery.findSegmentStarts(reader, docs);
|
||||
IndexReader indexReader = searcher.getIndexReader();
|
||||
int[] segments = AbstractKnnVectorQuery.findSegmentStarts(indexReader, docs);
|
||||
|
||||
AbstractKnnVectorQuery.DocAndScoreQuery query =
|
||||
new AbstractKnnVectorQuery.DocAndScoreQuery(
|
||||
docs, scores, maxScore, segments, reader.getContext().id());
|
||||
docs, scores, maxScore, segments, indexReader.getContext().id());
|
||||
final Weight w = query.createWeight(searcher, ScoreMode.TOP_SCORES, 1.0f);
|
||||
TopDocs topDocs = searcher.search(query, 100);
|
||||
assertEquals(scoreDocs.length, topDocs.totalHits.value);
|
||||
|
|
Loading…
Reference in New Issue