Module org.apache.lucene.core
Class Lucene99ScalarQuantizedVectorScorer
java.lang.Object
org.apache.lucene.codecs.lucene99.Lucene99ScalarQuantizedVectorScorer
- All Implemented Interfaces:
FlatVectorsScorer
Optimized scalar quantized implementation of
FlatVectorsScorer
for quantized vectors
stored in the Lucene99 format.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
Calculates dot product on quantized vectors, applying the appropriate correctionsprivate static class
private static interface
private static class
private static final class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static RandomVectorScorer.AbstractRandomVectorScorer
dotProductFactory
(byte[] targetBytes, float offsetCorrection, float constMultiplier, QuantizedByteVectorValues values, Lucene99ScalarQuantizedVectorScorer.FloatToFloatFunction scoreAdjustmentFunction) (package private) static RandomVectorScorer
fromVectorSimilarity
(byte[] targetBytes, float offsetCorrection, VectorSimilarityFunction sim, float constMultiplier, QuantizedByteVectorValues values) getRandomVectorScorer
(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues, byte[] target) Returns aRandomVectorScorer
for the given set of vectors and target vector.getRandomVectorScorer
(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues, float[] target) Returns aRandomVectorScorer
for the given set of vectors and target vector.getRandomVectorScorerSupplier
(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues) Returns aRandomVectorScorerSupplier
that can be used to score vectorstoString()
-
Field Details
-
nonQuantizedDelegate
-
-
Constructor Details
-
Lucene99ScalarQuantizedVectorScorer
-
-
Method Details
-
getRandomVectorScorerSupplier
public RandomVectorScorerSupplier getRandomVectorScorerSupplier(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues) throws IOException Description copied from interface:FlatVectorsScorer
Returns aRandomVectorScorerSupplier
that can be used to score vectors- Specified by:
getRandomVectorScorerSupplier
in interfaceFlatVectorsScorer
- Parameters:
similarityFunction
- the similarity function to usevectorValues
- the vector values to score- Returns:
- a
RandomVectorScorerSupplier
that can be used to score vectors - Throws:
IOException
- if an I/O error occurs
-
getRandomVectorScorer
public RandomVectorScorer getRandomVectorScorer(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues, float[] target) throws IOException Description copied from interface:FlatVectorsScorer
Returns aRandomVectorScorer
for the given set of vectors and target vector.- Specified by:
getRandomVectorScorer
in interfaceFlatVectorsScorer
- Parameters:
similarityFunction
- the similarity function to usevectorValues
- the vector values to scoretarget
- the target vector- Returns:
- a
RandomVectorScorer
for the given field and target vector. - Throws:
IOException
- if an I/O error occurs when reading from the index.
-
getRandomVectorScorer
public RandomVectorScorer getRandomVectorScorer(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues, byte[] target) throws IOException Description copied from interface:FlatVectorsScorer
Returns aRandomVectorScorer
for the given set of vectors and target vector.- Specified by:
getRandomVectorScorer
in interfaceFlatVectorsScorer
- Parameters:
similarityFunction
- the similarity function to usevectorValues
- the vector values to scoretarget
- the target vector- Returns:
- a
RandomVectorScorer
for the given field and target vector. - Throws:
IOException
- if an I/O error occurs when reading from the index.
-
toString
-
fromVectorSimilarity
static RandomVectorScorer fromVectorSimilarity(byte[] targetBytes, float offsetCorrection, VectorSimilarityFunction sim, float constMultiplier, QuantizedByteVectorValues values) -
dotProductFactory
private static RandomVectorScorer.AbstractRandomVectorScorer dotProductFactory(byte[] targetBytes, float offsetCorrection, float constMultiplier, QuantizedByteVectorValues values, Lucene99ScalarQuantizedVectorScorer.FloatToFloatFunction scoreAdjustmentFunction)
-