Package org.apache.lucene.codecs.hnsw
Class ScalarQuantizedVectorScorer
- java.lang.Object
-
- org.apache.lucene.codecs.hnsw.ScalarQuantizedVectorScorer
-
- All Implemented Interfaces:
FlatVectorsScorer
public class ScalarQuantizedVectorScorer extends Object implements FlatVectorsScorer
Default scalar quantized implementation ofFlatVectorsScorer.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScalarQuantizedVectorScorer.ScalarQuantizedRandomVectorScorerSupplierQuantized vector scorer supplier
-
Constructor Summary
Constructors Constructor Description ScalarQuantizedVectorScorer(FlatVectorsScorer flatVectorsScorer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RandomVectorScorergetRandomVectorScorer(VectorSimilarityFunction similarityFunction, RandomAccessVectorValues vectorValues, byte[] target)Returns aRandomVectorScorerfor the given set of vectors and target vector.RandomVectorScorergetRandomVectorScorer(VectorSimilarityFunction similarityFunction, RandomAccessVectorValues vectorValues, float[] target)Returns aRandomVectorScorerfor the given set of vectors and target vector.RandomVectorScorerSuppliergetRandomVectorScorerSupplier(VectorSimilarityFunction similarityFunction, RandomAccessVectorValues vectorValues)Returns aRandomVectorScorerSupplierthat can be used to score vectorsstatic floatquantizeQuery(float[] query, byte[] quantizedQuery, VectorSimilarityFunction similarityFunction, ScalarQuantizer scalarQuantizer)StringtoString()
-
-
-
Constructor Detail
-
ScalarQuantizedVectorScorer
public ScalarQuantizedVectorScorer(FlatVectorsScorer flatVectorsScorer)
-
-
Method Detail
-
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:FlatVectorsScorerReturns aRandomVectorScorerSupplierthat can be used to score vectors- Specified by:
getRandomVectorScorerSupplierin interfaceFlatVectorsScorer- Parameters:
similarityFunction- the similarity function to usevectorValues- the vector values to score- Returns:
- a
RandomVectorScorerSupplierthat 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:FlatVectorsScorerReturns aRandomVectorScorerfor the given set of vectors and target vector.- Specified by:
getRandomVectorScorerin interfaceFlatVectorsScorer- Parameters:
similarityFunction- the similarity function to usevectorValues- the vector values to scoretarget- the target vector- Returns:
- a
RandomVectorScorerfor 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:FlatVectorsScorerReturns aRandomVectorScorerfor the given set of vectors and target vector.- Specified by:
getRandomVectorScorerin interfaceFlatVectorsScorer- Parameters:
similarityFunction- the similarity function to usevectorValues- the vector values to scoretarget- the target vector- Returns:
- a
RandomVectorScorerfor the given field and target vector. - Throws:
IOException- if an I/O error occurs when reading from the index.
-
-