Module org.elasticsearch.simdvec
Class MemorySegmentES91OSQVectorsScorer
java.lang.Object
org.elasticsearch.simdvec.ES91OSQVectorsScorer
org.elasticsearch.simdvec.internal.vectorization.MemorySegmentES91OSQVectorsScorer
Panamized scorer for quantized vectors stored as a
MemorySegmentPREVIEW.-
Field Summary
Fields inherited from class org.elasticsearch.simdvec.ES91OSQVectorsScorer
additionalCorrections, bulkSize, dimensions, FOUR_BIT_SCALE, in, length, lowerIntervals, targetComponentSums, upperIntervals -
Constructor Summary
ConstructorsConstructorDescriptionMemorySegmentES91OSQVectorsScorer(org.apache.lucene.store.IndexInput in, int dimensions, int bulkSize) -
Method Summary
Modifier and TypeMethodDescriptionlongquantizeScore(byte[] q) compute the quantize distance between the provided quantized query and the quantized vector that is read from the wrappedIndexInput.voidquantizeScoreBulk(byte[] q, int count, float[] scores) compute the quantize distance between the provided quantized query and the quantized vectors that are read from the wrappedIndexInput.floatscoreBulk(byte[] q, float queryLowerInterval, float queryUpperInterval, int queryComponentSum, float queryAdditionalCorrection, org.apache.lucene.index.VectorSimilarityFunction similarityFunction, float centroidDp, float[] scores) compute the distance between the provided quantized query and the quantized vectors that are read from the wrappedIndexInput.Methods inherited from class org.elasticsearch.simdvec.ES91OSQVectorsScorer
score
-
Constructor Details
-
MemorySegmentES91OSQVectorsScorer
public MemorySegmentES91OSQVectorsScorer(org.apache.lucene.store.IndexInput in, int dimensions, int bulkSize)
-
-
Method Details
-
quantizeScore
Description copied from class:ES91OSQVectorsScorercompute the quantize distance between the provided quantized query and the quantized vector that is read from the wrappedIndexInput.- Overrides:
quantizeScorein classES91OSQVectorsScorer- Throws:
IOException
-
quantizeScoreBulk
Description copied from class:ES91OSQVectorsScorercompute the quantize distance between the provided quantized query and the quantized vectors that are read from the wrappedIndexInput. The number of quantized vectors to read is determined by {code count} and the results are stored in the providedscoresarray.- Overrides:
quantizeScoreBulkin classES91OSQVectorsScorer- Throws:
IOException
-
scoreBulk
public float scoreBulk(byte[] q, float queryLowerInterval, float queryUpperInterval, int queryComponentSum, float queryAdditionalCorrection, org.apache.lucene.index.VectorSimilarityFunction similarityFunction, float centroidDp, float[] scores) throws IOException Description copied from class:ES91OSQVectorsScorercompute the distance between the provided quantized query and the quantized vectors that are read from the wrappedIndexInput.The number of vectors to score is defined by
ES91OSQVectorsScorer.bulkSize. The expected format of the input is as follows: First the quantized vectors are read from the input,then all the lower intervals as floats, then all the upper intervals as floats, then all the target component sums as shorts, and finally all the additional corrections as floats.The results are stored in the provided scores array.
- Overrides:
scoreBulkin classES91OSQVectorsScorer- Throws:
IOException
-