Skip to content

Commit 2c98ead

Browse files
committed
fix handling of asymmetric in memory seg impl
1 parent 4d262f1 commit 2c98ead

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lucene/core/src/java25/org/apache/lucene/internal/vectorization/Lucene104MemorySegmentScalarQuantizedVectorScorer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.io.IOException;
2222
import java.lang.foreign.MemorySegment;
2323
import org.apache.lucene.codecs.hnsw.DefaultFlatVectorScorer;
24-
import org.apache.lucene.codecs.hnsw.FlatVectorsScorer;
2524
import org.apache.lucene.codecs.lucene104.AsymmetricScalarQuantizeFlatVectorsScorer;
2625
import org.apache.lucene.codecs.lucene104.Lucene104ScalarQuantizedVectorScorer;
2726
import org.apache.lucene.codecs.lucene104.Lucene104ScalarQuantizedVectorsFormat;
@@ -42,7 +41,7 @@ class Lucene104MemorySegmentScalarQuantizedVectorScorer
4241
static final Lucene104MemorySegmentScalarQuantizedVectorScorer INSTANCE =
4342
new Lucene104MemorySegmentScalarQuantizedVectorScorer();
4443

45-
private static final FlatVectorsScorer DELEGATE =
44+
private static final Lucene104ScalarQuantizedVectorScorer DELEGATE =
4645
new Lucene104ScalarQuantizedVectorScorer(DefaultFlatVectorScorer.INSTANCE);
4746

4847
private static final int CORRECTIVE_TERMS_SIZE = Float.BYTES * 3 + Integer.BYTES;
@@ -67,7 +66,9 @@ public RandomVectorScorerSupplier getRandomVectorScorerSupplier(
6766
QuantizedByteVectorValues scoringVectors,
6867
QuantizedByteVectorValues targetVectors)
6968
throws IOException {
70-
throw new UnsupportedOperationException("no asymmetric encodings are supported yet");
69+
// We do not yet support acceleration for any asymmetric formats.
70+
return DELEGATE.getRandomVectorScorerSupplier(
71+
similarityFunction, scoringVectors, targetVectors);
7172
}
7273

7374
@Override

0 commit comments

Comments
 (0)