Package org.apache.lucene.codecs.hnsw
Class ScalarQuantizedVectorScorer
java.lang.Object
org.apache.lucene.codecs.hnsw.ScalarQuantizedVectorScorer
- All Implemented Interfaces:
FlatVectorsScorer
Default scalar quantized implementation of
FlatVectorsScorer
.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Quantized vector scorer supplier -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetRandomVectorScorer
(VectorSimilarityFunction similarityFunction, RandomAccessVectorValues vectorValues, byte[] target) Returns aRandomVectorScorer
for the given set of vectors and target vector.getRandomVectorScorer
(VectorSimilarityFunction similarityFunction, RandomAccessVectorValues vectorValues, float[] target) Returns aRandomVectorScorer
for the given set of vectors and target vector.getRandomVectorScorerSupplier
(VectorSimilarityFunction similarityFunction, RandomAccessVectorValues vectorValues) Returns aRandomVectorScorerSupplier
that can be used to score vectorsstatic float
quantizeQuery
(float[] query, byte[] quantizedQuery, VectorSimilarityFunction similarityFunction, ScalarQuantizer scalarQuantizer) toString()
-
Constructor Details
-
ScalarQuantizedVectorScorer
-
-
Method Details
-
quantizeQuery
public static float quantizeQuery(float[] query, byte[] quantizedQuery, VectorSimilarityFunction similarityFunction, ScalarQuantizer scalarQuantizer) -
getRandomVectorScorerSupplier
public RandomVectorScorerSupplier getRandomVectorScorerSupplier(VectorSimilarityFunction similarityFunction, RandomAccessVectorValues 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, RandomAccessVectorValues 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, RandomAccessVectorValues 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
-