Skip to content

Commit

Permalink
fixing scorers
Browse files Browse the repository at this point in the history
  • Loading branch information
benwtrent committed Jan 29, 2025
1 parent 59dab18 commit 5e2ae5f
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void setScoringOrdinal(int node) throws IOException {

@Override
public float score(int node) throws IOException {
return similarityFunction.compare(vector, vectors1.vectorValue(ord));
return similarityFunction.compare(vector, vectors1.vectorValue(node));
}
};
}
Expand All @@ -133,14 +133,12 @@ public String toString() {
private static final class FloatScoringSupplier implements RandomVectorScorerSupplier {
private final FloatVectorValues vectors;
private final FloatVectorValues vectors1;
private final FloatVectorValues vectors2;
private final VectorSimilarityFunction similarityFunction;

private FloatScoringSupplier(
FloatVectorValues vectors, VectorSimilarityFunction similarityFunction) throws IOException {
this.vectors = vectors;
vectors1 = vectors.copy();
vectors2 = vectors.copy();
this.similarityFunction = similarityFunction;
}

Expand All @@ -151,7 +149,7 @@ public UpdateableRandomVectorScorer scorer(int ord) throws IOException {
return new UpdateableRandomVectorScorer.AbstractUpdateableRandomVectorScorer(vectors) {
@Override
public float score(int node) throws IOException {
return similarityFunction.compare(vectors1.vectorValue(ord), vectors2.vectorValue(node));
return similarityFunction.compare(vector, vectors1.vectorValue(node));
}

@Override
Expand Down

0 comments on commit 5e2ae5f

Please sign in to comment.