Package org.apache.lucene.util.quantization

## Class ScalarQuantizedRandomVectorScorer

- java.lang.Object
- - org.apache.lucene.util.hnsw.RandomVectorScorer.AbstractRandomVectorScorer<byte[]>
  - - org.apache.lucene.util.quantization.ScalarQuantizedRandomVectorScorer

- All Implemented Interfaces:
    `RandomVectorScorer`

      public class ScalarQuantizedRandomVectorScorer
      extends RandomVectorScorer.AbstractRandomVectorScorer<byte[]>

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

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.lucene.util.hnsw.RandomVectorScorer

      `RandomVectorScorer.AbstractRandomVectorScorer<T>`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ScalarQuantizedRandomVectorScorer​(VectorSimilarityFunction similarityFunction, ScalarQuantizer scalarQuantizer, RandomAccessQuantizedByteVectorValues values, float[] query)` |
    `ScalarQuantizedRandomVectorScorer​(ScalarQuantizedVectorSimilarity similarityFunction, RandomAccessQuantizedByteVectorValues values, byte[] query, float queryOffset)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static float` | `quantizeQuery​(float[] query, byte[] quantizedQuery, VectorSimilarityFunction similarityFunction, ScalarQuantizer scalarQuantizer)` |
    `float` | `score​(int node)` | Returns the score between the query and the provided node.

    - ### Methods inherited from class org.apache.lucene.util.hnsw.RandomVectorScorer.AbstractRandomVectorScorer

      `getAcceptOrds, maxOrd, ordToDoc`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ScalarQuantizedRandomVectorScorer

          public ScalarQuantizedRandomVectorScorer​(ScalarQuantizedVectorSimilarity similarityFunction,
                                                   RandomAccessQuantizedByteVectorValues values,
                                                   byte[] query,
                                                   float queryOffset)

    - #### ScalarQuantizedRandomVectorScorer

          public ScalarQuantizedRandomVectorScorer​(VectorSimilarityFunction similarityFunction,
                                                   ScalarQuantizer scalarQuantizer,
                                                   RandomAccessQuantizedByteVectorValues values,
                                                   float[] query)

  - ### Method Detail

    - #### quantizeQuery

          public static float quantizeQuery​(float[] query,
                                            byte[] quantizedQuery,
                                            VectorSimilarityFunction similarityFunction,
                                            ScalarQuantizer scalarQuantizer)

    - #### score

          public float score​(int node)
                      throws IOException

      Description copied from interface: `RandomVectorScorer`
      Returns the score between the query and the provided node.
      Parameters:
        `node` - a random node in the graph
      Returns:
        the computed score
      Throws:
        `IOException`