Class MemorySegmentES92Int7VectorsScorer

java.lang.Object
org.elasticsearch.simdvec.ES92Int7VectorsScorer
org.elasticsearch.simdvec.internal.MemorySegmentES92Int7VectorsScorer

public final class MemorySegmentES92Int7VectorsScorer extends ES92Int7VectorsScorer
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

    Constructors
    Constructor
    Description
    MemorySegmentES92Int7VectorsScorer(org.apache.lucene.store.IndexInput in, int dimensions, int bulkSize)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    applyCorrectionsBulk(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)
     
    boolean
    Checks if the current implementation supports fast native access.
    long
    int7DotProduct(byte[] q)
    compute the quantize distance between the provided quantized query and the quantized vector that is read from the wrapped IndexInput.
    void
    int7DotProductBulk(byte[] q, int count, float[] scores)
    compute the quantize distance between the provided quantized query and the quantized vectors that are read from the wrapped IndexInput.
    protected long
     
    protected void
    panamaInt7DotProductBulk(byte[] q, int count, float[] scores)
     
    void
    scoreBulk(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 wrapped IndexInput.

    Methods inherited from class org.elasticsearch.simdvec.ES92Int7VectorsScorer

    applyCorrections, score

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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: ES92Int7VectorsScorer
      Checks if the current implementation supports fast native access.
      Overrides:
      hasNativeAccess in class ES92Int7VectorsScorer
    • int7DotProduct

      public long int7DotProduct(byte[] q) throws IOException
      Description copied from class: ES92Int7VectorsScorer
      compute the quantize distance between the provided quantized query and the quantized vector that is read from the wrapped IndexInput.
      Overrides:
      int7DotProduct in class ES92Int7VectorsScorer
      Throws:
      IOException
    • int7DotProductBulk

      public void int7DotProductBulk(byte[] q, int count, float[] scores) throws IOException
      Description copied from class: ES92Int7VectorsScorer
      compute the quantize distance between the provided quantized query and the quantized vectors that are read from the wrapped IndexInput. The number of quantized vectors to read is determined by {code count} and the results are stored in the provided scores array.
      Overrides:
      int7DotProductBulk in class ES92Int7VectorsScorer
      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: ES92Int7VectorsScorer
      compute the distance between the provided quantized query and the quantized vectors that are read from the wrapped IndexInput.

      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:
      scoreBulk in class ES92Int7VectorsScorer
      Throws:
      IOException
    • getScratch

      protected byte[] getScratch(int len)
    • panamaInt7DotProduct

      protected long panamaInt7DotProduct(byte[] q) throws IOException
      Throws:
      IOException
    • panamaInt7DotProductBulk

      protected void panamaInt7DotProductBulk(byte[] q, int count, float[] scores) throws IOException
      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