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

Package org.apache.lucene.codecs.lucene104

# Class Lucene104ScalarQuantizedVectorsWriter

java.lang.Object
org.apache.lucene.codecs.KnnVectorsWriter
org.apache.lucene.codecs.hnsw.FlatVectorsWriter
org.apache.lucene.codecs.lucene104.Lucene104ScalarQuantizedVectorsWriter

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `Accountable`

public class Lucene104ScalarQuantizedVectorsWriter extends FlatVectorsWriter
Writes quantized vector values and metadata to index segments in the format for Lucene 10.4.

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

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.lucene.codecs.KnnVectorsWriter

  `KnnVectorsWriter.MergedVectorValues`

- ## Field Summary

  ### Fields inherited from class org.apache.lucene.codecs.hnsw.FlatVectorsWriter

  `vectorsScorer`

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

  `NULL_ACCOUNTABLE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Lucene104ScalarQuantizedVectorsWriter(SegmentWriteState state, QuantizedByteVectorValues.ScalarEncoding encoding, FlatVectorsWriter rawVectorDelegate, Lucene104ScalarQuantizedVectorScorer vectorsScorer)`
  Sole constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `FlatFieldVectorsWriter<?>`
  `addField(FieldInfo fieldInfo)`
  Add a new field for indexing
  `void`
  `close()`
  `void`
  `finish()`
  Called once at the end before close
  `void`
  `flush(int maxDoc, Sorter.DocMap sortMap)`
  Flush all buffered data on disk *
  `void`
  `mergeOneFlatVectorField(FieldInfo fieldInfo, MergeState mergeState)`
  `long`
  `ramBytesUsed()`
  Returns an estimate of the JVM heap memory used by this object in bytes.

  ### Methods inherited from class org.apache.lucene.codecs.hnsw.FlatVectorsWriter

  `getFlatVectorScorer, mergeOneField`

  ### Methods inherited from class org.apache.lucene.codecs.KnnVectorsWriter

  `mapOldOrdToNewOrd, merge`

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

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

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

  `getChildResources`

- ## Constructor Details

  - ### Lucene104ScalarQuantizedVectorsWriter

    public Lucene104ScalarQuantizedVectorsWriter(SegmentWriteState state, QuantizedByteVectorValues.ScalarEncoding encoding, FlatVectorsWriter rawVectorDelegate, Lucene104ScalarQuantizedVectorScorer vectorsScorer) throws IOException
    Sole constructor
    Throws:
      `IOException`

- ## Method Details

  - ### addField

    public FlatFieldVectorsWriter<?> addField(FieldInfo fieldInfo) throws IOException
    Description copied from class: `FlatVectorsWriter`
    Add a new field for indexing
    Specified by:
      `addField` in class `FlatVectorsWriter`
    Parameters:
      `fieldInfo` - fieldInfo of the field to add
    Returns:
      a writer for the field
    Throws:
      `IOException` - if an I/O error occurs when adding the field

  - ### flush

    public void flush(int maxDoc, Sorter.DocMap sortMap) throws IOException
    Description copied from class: `KnnVectorsWriter`
    Flush all buffered data on disk *
    Specified by:
      `flush` in class `KnnVectorsWriter`
    Throws:
      `IOException`

  - ### finish

    public void finish() throws IOException
    Description copied from class: `KnnVectorsWriter`
    Called once at the end before close
    Specified by:
      `finish` in class `KnnVectorsWriter`
    Throws:
      `IOException`

  - ### mergeOneFlatVectorField

    public void mergeOneFlatVectorField(FieldInfo fieldInfo, MergeState mergeState) throws IOException
    Specified by:
      `mergeOneFlatVectorField` in class `FlatVectorsWriter`
    Throws:
      `IOException`

  - ### close

    public void close() throws IOException
    Throws:
      `IOException`

  - ### ramBytesUsed

    public long ramBytesUsed()
    Description copied from interface: `Accountable`
    Returns an estimate of the JVM heap memory used by this object in bytes. The method name uses "ram" for historical reasons; only JVM heap memory should be reported. Off-heap resources such as memory-mapped files or native direct buffers should not be included. Negative values are illegal.