Lucene104ScalarQuantizedVectorsReader.ScalarQuantizedVectorValues (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.codecs.lucene104, class: Lucene104ScalarQuantizedVectorsReader, class: ScalarQuantizedVectorValues

Package org.apache.lucene.codecs.lucene104

# Class Lucene104ScalarQuantizedVectorsReader.ScalarQuantizedVectorValues

java.lang.Object
org.apache.lucene.index.KnnVectorValues
org.apache.lucene.index.FloatVectorValues
org.apache.lucene.codecs.lucene104.Lucene104ScalarQuantizedVectorsReader.ScalarQuantizedVectorValues

Enclosing class:
  `Lucene104ScalarQuantizedVectorsReader`

protected static final class Lucene104ScalarQuantizedVectorsReader.ScalarQuantizedVectorValues extends FloatVectorValues
Vector values holding row and quantized vector values

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.lucene.index.KnnVectorValues

  `KnnVectorValues.DocIndexIterator`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Lucene104ScalarQuantizedVectorsReader.ScalarQuantizedVectorValues`
  `copy()`
  Creates a new copy of this `KnnVectorValues`.
  `int`
  `dimension()`
  Return the dimension of the vectors
  `Bits`
  `getAcceptOrds(Bits acceptDocs)`
  Returns a Bits accepting docs accepted by the argument and having a vector value
  `KnnVectorValues.DocIndexIterator`
  `iterator()`
  Create an iterator for this instance.
  `int`
  `ordToDoc(int ord)`
  Return the docid of the document indexed with the given vector ordinal.
  `VectorScorer`
  `rescorer(float[] target)`
  Rescore using the given query vector and the current `FloatVectorValues`.
  `VectorScorer`
  `scorer(float[] query)`
  Return a `VectorScorer` for the given query vector and the current `FloatVectorValues`.
  `int`
  `size()`
  Return the number of vectors for this field.
  `float[]`
  `vectorValue(int ord)`
  Return the vector value for the given vector ordinal which must be in [0, size() - 1], otherwise IndexOutOfBoundsException is thrown.

  ### Methods inherited from class org.apache.lucene.index.FloatVectorValues

  `checkField, fromFloats, getEncoding`

  ### Methods inherited from class org.apache.lucene.index.KnnVectorValues

  `createDenseIterator, createSparseIterator, fromDISI, getVectorByteLength, prefetch`

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

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

- ## Method Details

  - ### dimension

    public int dimension()
    Description copied from class: `KnnVectorValues`
    Return the dimension of the vectors
    Specified by:
      `dimension` in class `KnnVectorValues`

  - ### size

    public int size()
    Description copied from class: `KnnVectorValues`
    Return the number of vectors for this field.
    Specified by:
      `size` in class `KnnVectorValues`
    Returns:
      the number of vectors returned by this iterator

  - ### vectorValue

    public float[] vectorValue(int ord) throws IOException
    Description copied from class: `FloatVectorValues`
    Return the vector value for the given vector ordinal which must be in [0, size() - 1], otherwise IndexOutOfBoundsException is thrown. The returned array may be shared across calls.
    Specified by:
      `vectorValue` in class `FloatVectorValues`
    Returns:
      the vector value
    Throws:
      `IOException`

  - ### copy

    public Lucene104ScalarQuantizedVectorsReader.ScalarQuantizedVectorValues copy() throws IOException
    Description copied from class: `KnnVectorValues`
    Creates a new copy of this `KnnVectorValues`. This is helpful when you need to access different values at once, to avoid overwriting the underlying vector returned.
    Specified by:
      `copy` in class `FloatVectorValues`
    Throws:
      `IOException`

  - ### getAcceptOrds

    public Bits getAcceptOrds(Bits acceptDocs)
    Description copied from class: `KnnVectorValues`
    Returns a Bits accepting docs accepted by the argument and having a vector value
    Overrides:
      `getAcceptOrds` in class `KnnVectorValues`

  - ### ordToDoc

    public int ordToDoc(int ord)
    Description copied from class: `KnnVectorValues`
    Return the docid of the document indexed with the given vector ordinal. This default implementation returns the argument and is appropriate for dense values implementations where every doc has a single value.
    Overrides:
      `ordToDoc` in class `KnnVectorValues`

  - ### iterator

    public KnnVectorValues.DocIndexIterator iterator()
    Description copied from class: `KnnVectorValues`
    Create an iterator for this instance.
    Overrides:
      `iterator` in class `KnnVectorValues`

  - ### scorer

    public VectorScorer scorer(float[] query) throws IOException
    Description copied from class: `FloatVectorValues`
    Return a `VectorScorer` for the given query vector and the current `FloatVectorValues`. When the underlying format quantizes the vectors, this will return a `VectorScorer` that scores against the quantized vectors.
    Overrides:
      `scorer` in class `FloatVectorValues`
    Parameters:
      `query` - the query vector
    Returns:
      a `VectorScorer` instance or null
    Throws:
      `IOException`

  - ### rescorer

    public VectorScorer rescorer(float[] target) throws IOException
    Description copied from class: `FloatVectorValues`
    Rescore using the given query vector and the current `FloatVectorValues`. This is unique from scorer() in that it is explicitly for rescoring an existing set of hits and thus will often utilize the highest fidelity scoring algorithm available. This is useful when the initial search used a quantized index or an approximate search algorithm, and now we want to rescore the hits using the full fidelity vectors. The default implementation is to call `FloatVectorValues.scorer(float[])` assuming that the scorer is already the highest fidelity implementation available.
    Overrides:
      `rescorer` in class `FloatVectorValues`
    Parameters:
      `target` - the query vector
    Returns:
      a `VectorScorer` instance or null
    Throws:
      `IOException` - if an I/O error occurs