Interface VectorScorerFactory


public interface VectorScorerFactory
A factory of quantized vector scorers.
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<org.apache.lucene.util.hnsw.RandomVectorScorer>
    getInt7SQVectorScorer(org.apache.lucene.index.VectorSimilarityFunction sim, org.apache.lucene.util.quantization.RandomAccessQuantizedByteVectorValues values, float[] queryVector)
    Returns an optional containing an int7 scalar quantized vector scorer for the given parameters, or an empty optional if a scorer is not supported.
    Optional<org.apache.lucene.util.hnsw.RandomVectorScorerSupplier>
    getInt7SQVectorScorerSupplier(VectorSimilarityType similarityType, org.apache.lucene.store.IndexInput input, org.apache.lucene.util.quantization.RandomAccessQuantizedByteVectorValues values, float scoreCorrectionConstant)
    Returns an optional containing an int7 scalar quantized vector score supplier for the given parameters, or an empty optional if a scorer is not supported.
     
  • Method Details

    • instance

      static Optional<VectorScorerFactory> instance()
    • getInt7SQVectorScorerSupplier

      Optional<org.apache.lucene.util.hnsw.RandomVectorScorerSupplier> getInt7SQVectorScorerSupplier(VectorSimilarityType similarityType, org.apache.lucene.store.IndexInput input, org.apache.lucene.util.quantization.RandomAccessQuantizedByteVectorValues values, float scoreCorrectionConstant)
      Returns an optional containing an int7 scalar quantized vector score supplier for the given parameters, or an empty optional if a scorer is not supported.
      Parameters:
      similarityType - the similarity type
      input - the index input containing the vector data; offset of the first vector is 0, the length must be (maxOrd + Float#BYTES) * dims
      values - the random access vector values
      scoreCorrectionConstant - the score correction constant
      Returns:
      an optional containing the vector scorer supplier, or empty
    • getInt7SQVectorScorer

      Optional<org.apache.lucene.util.hnsw.RandomVectorScorer> getInt7SQVectorScorer(org.apache.lucene.index.VectorSimilarityFunction sim, org.apache.lucene.util.quantization.RandomAccessQuantizedByteVectorValues values, float[] queryVector)
      Returns an optional containing an int7 scalar quantized vector scorer for the given parameters, or an empty optional if a scorer is not supported.
      Parameters:
      sim - the similarity type
      values - the random access vector values
      queryVector - the query vector
      Returns:
      an optional containing the vector scorer, or empty