Class MemorySegmentES940OSQVectorsScorer

java.lang.Object
org.elasticsearch.simdvec.ES940OSQVectorsScorer
org.elasticsearch.simdvec.internal.vectorization.MemorySegmentES940OSQVectorsScorer

public final class MemorySegmentES940OSQVectorsScorer extends ES940OSQVectorsScorer
Panamized scorer for quantized vectors stored as a MemorySegmentPREVIEW.
  • 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

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

      public void quantizeScoreBulk(byte[] q, int count, float[] scores) throws IOException
      Description copied from class: ES940OSQVectorsScorer
      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 and the results are stored in the provided array.
      Overrides:
      quantizeScoreBulk in class ES940OSQVectorsScorer
      Throws:
      IOException
    • quantizeScoreBulkOffsets

      public void quantizeScoreBulkOffsets(byte[] q, int[] offsets, int offsetsCount, float[] scores, int count) throws IOException
      Description copied from class: ES940OSQVectorsScorer
      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 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:
      quantizeScoreBulkOffsets in class ES940OSQVectorsScorer
      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: ES940OSQVectorsScorer
      Overrides:
      scoreBulk in class ES940OSQVectorsScorer
      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: ES940OSQVectorsScorer
      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 . 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:
      scoreBulk in class ES940OSQVectorsScorer
      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: ES940OSQVectorsScorer
      Compute the distance between the provided quantized query and the quantized vectors that are read from the wrapped IndexInput.

      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:
      scoreBulkOffsets in class ES940OSQVectorsScorer
      Throws:
      IOException