Module org.elasticsearch.simdvec
Class MemorySegmentES940OSQVectorsScorer
java.lang.Object
org.elasticsearch.simdvec.ES940OSQVectorsScorer
org.elasticsearch.simdvec.internal.vectorization.MemorySegmentES940OSQVectorsScorer
Panamized scorer for quantized vectors stored as a
MemorySegmentPREVIEW.-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.simdvec.ES940OSQVectorsScorer
ES940OSQVectorsScorer.SymmetricInt4Encoding -
Field Summary
Fields inherited from class org.elasticsearch.simdvec.ES940OSQVectorsScorer
additionalCorrections, BIT_SCALES, BULK_SIZE, bulkSize, dimensions, in, indexBits, int4Encoding, length, lowerIntervals, queryBits, targetComponentSums, upperIntervals -
Constructor Summary
ConstructorsConstructorDescriptionMemorySegmentES940OSQVectorsScorer(org.apache.lucene.store.IndexInput in, byte queryBits, byte indexBits, int dimensions, int dataLength, int bulkSize, ES940OSQVectorsScorer.SymmetricInt4Encoding int4Encoding) -
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.voidquantizeScoreBulkOffsets(byte[] q, int[] offsets, int offsetsCount, float[] scores, int count) 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) Bulk score overload; same asES940OSQVectorsScorer.scoreBulk(byte[], float, float, int, float, VectorSimilarityFunction, float, float[], int)withES940OSQVectorsScorer.bulkSizeas the defaultbulkSizeparam value.floatscoreBulk(byte[] q, float queryLowerInterval, float queryUpperInterval, int queryComponentSum, float queryAdditionalCorrection, org.apache.lucene.index.VectorSimilarityFunction similarityFunction, float centroidDp, float[] scores, int bulkSize) Compute the distance between the provided quantized query and the quantized vectors that are read from the wrappedIndexInput.floatscoreBulkOffsets(byte[] q, float queryLowerInterval, float queryUpperInterval, int queryComponentSum, float queryAdditionalCorrection, org.apache.lucene.index.VectorSimilarityFunction similarityFunction, float centroidDp, int[] offsets, int offsetsCount, float[] scores, int count) 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.ES940OSQVectorsScorer
applyCorrectionsIndividually
-
Constructor Details
-
MemorySegmentES940OSQVectorsScorer
public MemorySegmentES940OSQVectorsScorer(org.apache.lucene.store.IndexInput in, byte queryBits, byte indexBits, int dimensions, int dataLength, int bulkSize, ES940OSQVectorsScorer.SymmetricInt4Encoding int4Encoding)
-
-
Method Details
-
quantizeScore
Description copied from class:ES940OSQVectorsScorercompute the quantize distance between the provided quantized query and the quantized vector that is read from the wrappedIndexInput.- Overrides:
quantizeScorein classES940OSQVectorsScorer- Throws:
IOException
-
quantizeScoreBulk
Description copied from class:ES940OSQVectorsScorerCompute 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 and the results are stored in the provided array.- Overrides:
quantizeScoreBulkin classES940OSQVectorsScorer- Throws:
IOException
-
quantizeScoreBulkOffsets
public void quantizeScoreBulkOffsets(byte[] q, int[] offsets, int offsetsCount, float[] scores, int count) throws IOException Description copied from class:ES940OSQVectorsScorerCompute 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 and the results are stored in the provided array. Only the vectors that are indexed in the provided are scored; the others are skipped.- Overrides:
quantizeScoreBulkOffsetsin classES940OSQVectorsScorer- 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:ES940OSQVectorsScorerBulk score overload; same asES940OSQVectorsScorer.scoreBulk(byte[], float, float, int, float, VectorSimilarityFunction, float, float[], int)withES940OSQVectorsScorer.bulkSizeas the defaultbulkSizeparam value.- Overrides:
scoreBulkin classES940OSQVectorsScorer- 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, int bulkSize) throws IOException Description copied from class:ES940OSQVectorsScorerCompute 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 . 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 array.
- Overrides:
scoreBulkin classES940OSQVectorsScorer- Throws:
IOException
-
scoreBulkOffsets
public float scoreBulkOffsets(byte[] q, float queryLowerInterval, float queryUpperInterval, int queryComponentSum, float queryAdditionalCorrection, org.apache.lucene.index.VectorSimilarityFunction similarityFunction, float centroidDp, int[] offsets, int offsetsCount, float[] scores, int count) throws IOException Description copied from class:ES940OSQVectorsScorerCompute the distance between the provided quantized query and the quantized vectors that are read from the wrappedIndexInput.Similar to
ES940OSQVectorsScorer.scoreBulk(byte[], float, float, int, float, org.apache.lucene.index.VectorSimilarityFunction, float, float[]), but only the vectors indexed by the provided are scored; the others are skipped.The results are stored in the provided array.
- Overrides:
scoreBulkOffsetsin classES940OSQVectorsScorer- Throws:
IOException
-