Class KnnFieldVectorsWriter<T>

java.lang.Object
org.apache.lucene.codecs.KnnFieldVectorsWriter<T>
Type Parameters:
T - an array type; the type of vectors to be written
All Implemented Interfaces:
Accountable
Direct Known Subclasses:
BufferingKnnVectorsWriter.FieldWriter, Lucene94HnswVectorsWriter.FieldWriter

public abstract class KnnFieldVectorsWriter<T> extends Object implements Accountable
Vectors' writer for a field
  • Constructor Details

    • KnnFieldVectorsWriter

      protected KnnFieldVectorsWriter()
      Sole constructor
  • Method Details

    • addValue

      public abstract void addValue(int docID, Object vectorValue) throws IOException
      Add new docID with its vector value to the given field for indexing. Doc IDs must be added in increasing order.
      Throws:
      IOException
    • copyValue

      public abstract T copyValue(T vectorValue)
      Used to copy values being indexed to internal storage.
      Parameters:
      vectorValue - an array containing the vector value to add
      Returns:
      a copy of the value; a new array