Class Lucene92HnswVectorsWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public final class Lucene92HnswVectorsWriter
    extends KnnVectorsWriter
    Writes vector values and knn graphs to index segments.
    • Field Detail

      • maxDoc

        private final int maxDoc
      • M

        private final int M
      • beamWidth

        private final int beamWidth
      • finished

        private boolean finished
    • Constructor Detail

      • Lucene92HnswVectorsWriter

        Lucene92HnswVectorsWriter​(SegmentWriteState state,
                                  int M,
                                  int beamWidth)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • writeVectorData

        private static DocsWithFieldSet writeVectorData​(IndexOutput output,
                                                        VectorValues vectors)
                                                 throws java.io.IOException
        Writes the vector values to the output and returns a set of documents that contains vectors.
        Throws:
        java.io.IOException
      • writeMeta

        private void writeMeta​(FieldInfo field,
                               long vectorDataOffset,
                               long vectorDataLength,
                               long vectorIndexOffset,
                               long vectorIndexLength,
                               DocsWithFieldSet docsWithField,
                               OnHeapHnswGraph graph)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • finish

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

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException