Class Lucene92HnswVectorsWriter
java.lang.Object
org.apache.lucene.codecs.KnnVectorsWriter
org.apache.lucene.codecs.lucene92.Lucene92HnswVectorsWriter
- All Implemented Interfaces:
Closeable,AutoCloseable
Writes vector values and knn graphs to index segments.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate booleanprivate final intprivate final intprivate final IndexOutputprivate final SegmentWriteStateprivate final IndexOutputprivate final IndexOutput -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidfinish()Called once at the end before closevoidwriteField(FieldInfo fieldInfo, KnnVectorsReader knnVectorsReader) Write all values contained in the provided readerprivate OnHeapHnswGraphwriteGraph(RandomAccessVectorValuesProducer vectorValues, VectorSimilarityFunction similarityFunction) private voidwriteMeta(FieldInfo field, long vectorDataOffset, long vectorDataLength, long vectorIndexOffset, long vectorIndexLength, DocsWithFieldSet docsWithField, OnHeapHnswGraph graph) private static DocsWithFieldSetwriteVectorData(IndexOutput output, VectorValues vectors) Writes the vector values to the output and returns a set of documents that contains vectors.Methods inherited from class org.apache.lucene.codecs.KnnVectorsWriter
merge
-
Field Details
-
segmentWriteState
-
meta
-
vectorData
-
vectorIndex
-
maxDoc
private final int maxDoc -
M
private final int M -
beamWidth
private final int beamWidth -
finished
private boolean finished
-
-
Constructor Details
-
Lucene92HnswVectorsWriter
Lucene92HnswVectorsWriter(SegmentWriteState state, int M, int beamWidth) throws IOException - Throws:
IOException
-
-
Method Details
-
writeField
Description copied from class:KnnVectorsWriterWrite all values contained in the provided reader- Specified by:
writeFieldin classKnnVectorsWriter- Throws:
IOException
-
writeVectorData
private static DocsWithFieldSet writeVectorData(IndexOutput output, VectorValues vectors) throws IOException Writes the vector values to the output and returns a set of documents that contains vectors.- Throws:
IOException
-
writeMeta
private void writeMeta(FieldInfo field, long vectorDataOffset, long vectorDataLength, long vectorIndexOffset, long vectorIndexLength, DocsWithFieldSet docsWithField, OnHeapHnswGraph graph) throws IOException - Throws:
IOException
-
writeGraph
private OnHeapHnswGraph writeGraph(RandomAccessVectorValuesProducer vectorValues, VectorSimilarityFunction similarityFunction) throws IOException - Throws:
IOException
-
finish
Description copied from class:KnnVectorsWriterCalled once at the end before close- Specified by:
finishin classKnnVectorsWriter- Throws:
IOException
-
close
- Throws:
IOException
-