Module org.apache.lucene.core
Class ScalarQuantizedRandomVectorScorer
java.lang.Object
org.apache.lucene.util.hnsw.RandomVectorScorer.AbstractRandomVectorScorer<byte[]>
org.apache.lucene.codecs.lucene99.ScalarQuantizedRandomVectorScorer
- All Implemented Interfaces:
RandomVectorScorer
final class ScalarQuantizedRandomVectorScorer
extends RandomVectorScorer.AbstractRandomVectorScorer<byte[]>
Quantized vector scorer
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.lucene.util.hnsw.RandomVectorScorer
RandomVectorScorer.AbstractRandomVectorScorer<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]
private final float
private final ScalarQuantizedVectorSimilarity
private final RandomAccessQuantizedByteVectorValues
-
Constructor Summary
ConstructorsConstructorDescriptionScalarQuantizedRandomVectorScorer
(VectorSimilarityFunction similarityFunction, ScalarQuantizer scalarQuantizer, RandomAccessQuantizedByteVectorValues values, float[] query) ScalarQuantizedRandomVectorScorer
(ScalarQuantizedVectorSimilarity similarityFunction, RandomAccessQuantizedByteVectorValues values, byte[] query, float queryOffset) -
Method Summary
Modifier and TypeMethodDescriptionprivate static float
quantizeQuery
(float[] query, byte[] quantizedQuery, VectorSimilarityFunction similarityFunction, ScalarQuantizer scalarQuantizer) float
score
(int node) Returns the score between the query and the provided node.Methods inherited from class org.apache.lucene.util.hnsw.RandomVectorScorer.AbstractRandomVectorScorer
getAcceptOrds, maxOrd, ordToDoc
-
Field Details
-
quantizedQuery
private final byte[] quantizedQuery -
queryOffset
private final float queryOffset -
values
-
similarity
-
-
Constructor Details
-
ScalarQuantizedRandomVectorScorer
ScalarQuantizedRandomVectorScorer(ScalarQuantizedVectorSimilarity similarityFunction, RandomAccessQuantizedByteVectorValues values, byte[] query, float queryOffset) -
ScalarQuantizedRandomVectorScorer
ScalarQuantizedRandomVectorScorer(VectorSimilarityFunction similarityFunction, ScalarQuantizer scalarQuantizer, RandomAccessQuantizedByteVectorValues values, float[] query)
-
-
Method Details
-
quantizeQuery
private static float quantizeQuery(float[] query, byte[] quantizedQuery, VectorSimilarityFunction similarityFunction, ScalarQuantizer scalarQuantizer) -
score
Description copied from interface:RandomVectorScorer
Returns the score between the query and the provided node.- Parameters:
node
- a random node in the graph- Returns:
- the computed score
- Throws:
IOException
-