QuantizedVectorsReader (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.util.quantization, interface: QuantizedVectorsReader

Package org.apache.lucene.util.quantization

# Interface QuantizedVectorsReader

All Superinterfaces:
  `Accountable`, `AutoCloseable`, `Closeable`

All Known Implementing Classes:
  `Lucene104ScalarQuantizedVectorsReader`, `Lucene99HnswVectorsReader`

public interface QuantizedVectorsReader extends Closeable, Accountable
Quantized vector reader

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

- ## Field Summary

  ### Fields inherited from interface org.apache.lucene.util.Accountable

  `NULL_ACCOUNTABLE`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ScalarQuantizer`
  `getQuantizationState(String fieldName)`
  `BaseQuantizedByteVectorValues`
  `getQuantizedVectorValues(String fieldName)`
  `CloseableRandomVectorScorerSupplier`
  `getRandomVectorScorerSupplierForMerge(FieldInfo fieldInfo, SegmentWriteState segmentWriteState)`
  Provides a scorer for merging this quantized vector reader.

  ### Methods inherited from interface org.apache.lucene.util.Accountable

  `getChildResources, ramBytesUsed`

  ### Methods inherited from interface java.io.Closeable

  `close`

- ## Method Details

  - ### getQuantizedVectorValues

    BaseQuantizedByteVectorValues getQuantizedVectorValues(String fieldName) throws IOException
    Throws:
      `IOException`

  - ### getQuantizationState

    ScalarQuantizer getQuantizationState(String fieldName)

  - ### getRandomVectorScorerSupplierForMerge

    CloseableRandomVectorScorerSupplier getRandomVectorScorerSupplierForMerge(FieldInfo fieldInfo, SegmentWriteState segmentWriteState) throws IOException
    Provides a scorer for merging this quantized vector reader. This way any additional merging logic can be implemented by the user of this class.
    Parameters:
      `fieldInfo` - fieldInfo of the field to merge
      `segmentWriteState` - the SegmentWriteState to write temporary files if needed
    Returns:
      a scorer over the newly merged flat vectors, which should be closed as it may hold temporary file handles to read over auxiliary data structures
    Throws:
      `IOException` - if an I/O error occurs when merging