mirror of https://github.com/apache/lucene.git
LUCENE-10063: Fix score calculation in SimpleTextKnnVectorsFormat
The method VectorSimilarityFunction#convertToScore already reverses the similarity, so we shouldn't reverse it again.
This commit is contained in:
parent
f725b27e12
commit
2a9adb81df
|
@ -160,9 +160,6 @@ public class SimpleTextKnnVectorsReader extends KnnVectorsReader {
|
|||
}
|
||||
float[] vector = values.vectorValue();
|
||||
float score = vectorSimilarity.convertToScore(vectorSimilarity.compare(vector, target));
|
||||
if (vectorSimilarity.reversed) {
|
||||
score = 1 / (score + 1);
|
||||
}
|
||||
topK.insertWithOverflow(new ScoreDoc(doc, score));
|
||||
}
|
||||
ScoreDoc[] topScoreDocs = new ScoreDoc[topK.size()];
|
||||
|
|
Loading…
Reference in New Issue