Module org.elasticsearch.simdvec
Class MemorySegmentES92Int7VectorsScorer
java.lang.Object
org.elasticsearch.simdvec.ES92Int7VectorsScorer
org.elasticsearch.simdvec.internal.MemorySegmentES92Int7VectorsScorer
Native / panamized scorer for 7-bit quantized vectors stored as an
IndexInput.-
Field Summary
Fields inherited from class org.elasticsearch.simdvec.ES92Int7VectorsScorer
dimensions, in, SEVEN_BIT_SCALE -
Constructor Summary
ConstructorsConstructorDescriptionMemorySegmentES92Int7VectorsScorer(org.apache.lucene.store.IndexInput in, int dimensions, int bulkSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyCorrectionsBulk(float queryLowerInterval, float queryUpperInterval, int queryComponentSum, float queryAdditionalCorrection, org.apache.lucene.index.VectorSimilarityFunction similarityFunction, float centroidDp, float[] scores, int bulkSize) protected byte[]getScratch(int len) booleanChecks if the current implementation supports fast native access.longint7DotProduct(byte[] q) compute the quantize distance between the provided quantized query and the quantized vector that is read from the wrappedIndexInput.voidint7DotProductBulk(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.protected longpanamaInt7DotProduct(byte[] q) protected voidpanamaInt7DotProductBulk(byte[] q, int count, float[] scores) voidscoreBulk(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.Methods inherited from class org.elasticsearch.simdvec.ES92Int7VectorsScorer
applyCorrections, score
-
Constructor Details
-
MemorySegmentES92Int7VectorsScorer
public MemorySegmentES92Int7VectorsScorer(org.apache.lucene.store.IndexInput in, int dimensions, int bulkSize)
-
-
Method Details
-
hasNativeAccess
public boolean hasNativeAccess()Description copied from class:ES92Int7VectorsScorerChecks if the current implementation supports fast native access.- Overrides:
hasNativeAccessin classES92Int7VectorsScorer
-
int7DotProduct
Description copied from class:ES92Int7VectorsScorercompute the quantize distance between the provided quantized query and the quantized vector that is read from the wrappedIndexInput.- Overrides:
int7DotProductin classES92Int7VectorsScorer- Throws:
IOException
-
int7DotProductBulk
Description copied from class:ES92Int7VectorsScorercompute 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:
int7DotProductBulkin classES92Int7VectorsScorer- Throws:
IOException
-
scoreBulk
public void 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:ES92Int7VectorsScorercompute 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
#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 classES92Int7VectorsScorer- Throws:
IOException
-
getScratch
protected byte[] getScratch(int len) -
panamaInt7DotProduct
- Throws:
IOException
-
panamaInt7DotProductBulk
- Throws:
IOException
-
applyCorrectionsBulk
protected void applyCorrectionsBulk(float queryLowerInterval, float queryUpperInterval, int queryComponentSum, float queryAdditionalCorrection, org.apache.lucene.index.VectorSimilarityFunction similarityFunction, float centroidDp, float[] scores, int bulkSize) throws IOException - Throws:
IOException
-