Package org.apache.lucene.codecs.hnsw
Interface FlatVectorsScorer
- All Known Implementing Classes:
DefaultFlatVectorScorer,Lucene102BinaryFlatVectorsScorer,Lucene99ScalarQuantizedVectorScorer,ScalarQuantizedVectorScorer
public interface FlatVectorsScorer
Provides mechanisms to score vectors that are stored in a flat file The purpose of this class is
for providing flexibility to the codec utilizing the vectors
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Method Summary
Modifier and TypeMethodDescriptiongetRandomVectorScorer(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues, byte[] target) Returns aRandomVectorScorerfor the given set of vectors and target vector.getRandomVectorScorer(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues, float[] target) Returns aRandomVectorScorerfor the given set of vectors and target vector.getRandomVectorScorerSupplier(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues) Returns aRandomVectorScorerSupplierthat can be used to score vectors
-
Method Details
-
getRandomVectorScorerSupplier
RandomVectorScorerSupplier getRandomVectorScorerSupplier(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues) throws IOException Returns aRandomVectorScorerSupplierthat can be used to score vectors- 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
RandomVectorScorer getRandomVectorScorer(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues, float[] target) throws IOException Returns aRandomVectorScorerfor the given set of vectors and target vector.- 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
RandomVectorScorer getRandomVectorScorer(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues, byte[] target) throws IOException Returns aRandomVectorScorerfor the given set of vectors and target vector.- 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.
-