FlatVectorsScorer (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.codecs.hnsw, interface: FlatVectorsScorer

Package org.apache.lucene.codecs.hnsw

# Interface FlatVectorsScorer

All Known Implementing Classes:
  `DefaultFlatVectorScorer`, `Lucene104ScalarQuantizedVectorScorer`, `Lucene99ScalarQuantizedVectorScorer`, `PrefetchableFlatVectorScorer`, `ScalarQuantizedVectorScorer`

public interface FlatVectorsScorer
Provides mechanisms to score vectors that are stored in a flat file The purpose of this class is for providing flexibility to the codec utilizing the vectors

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `checkDimensions(int queryLen, int fieldLen)`
  `RandomVectorScorer`
  `getRandomVectorScorer(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues, byte[] target)`
  Returns a `RandomVectorScorer` for the given set of vectors and target vector.
  `RandomVectorScorer`
  `getRandomVectorScorer(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues, float[] target)`
  Returns a `RandomVectorScorer` for the given set of vectors and target vector.
  `RandomVectorScorerSupplier`
  `getRandomVectorScorerSupplier(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues)`
  Returns a `RandomVectorScorerSupplier` that can be used to score vectors

- ## Method Details

  - ### getRandomVectorScorerSupplier

    RandomVectorScorerSupplier getRandomVectorScorerSupplier(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues) throws IOException
    Returns a `RandomVectorScorerSupplier` that can be used to score vectors
    Parameters:
      `similarityFunction` - the similarity function to use
      `vectorValues` - the vector values to score
    Returns:
      a `RandomVectorScorerSupplier` that can be used to score vectors
    Throws:
      `IOException` - if an I/O error occurs

  - ### getRandomVectorScorer

    RandomVectorScorer getRandomVectorScorer(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues, float[] target) throws IOException
    Returns a `RandomVectorScorer` for the given set of vectors and target vector.
    Parameters:
      `similarityFunction` - the similarity function to use
      `vectorValues` - the vector values to score
      `target` - the target vector
    Returns:
      a `RandomVectorScorer` for the given field and target vector.
    Throws:
      `IOException` - if an I/O error occurs when reading from the index.

  - ### getRandomVectorScorer

    RandomVectorScorer getRandomVectorScorer(VectorSimilarityFunction similarityFunction, KnnVectorValues vectorValues, byte[] target) throws IOException
    Returns a `RandomVectorScorer` for the given set of vectors and target vector.
    Parameters:
      `similarityFunction` - the similarity function to use
      `vectorValues` - the vector values to score
      `target` - the target vector
    Returns:
      a `RandomVectorScorer` for the given field and target vector.
    Throws:
      `IOException` - if an I/O error occurs when reading from the index.

  - ### checkDimensions

    static void checkDimensions(int queryLen, int fieldLen)