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 int
private boolean
private final int
private final int
private final IndexOutput
private final SegmentWriteState
private final IndexOutput
private final IndexOutput
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
finish()
Called once at the end before closevoid
writeField
(FieldInfo fieldInfo, KnnVectorsReader knnVectorsReader) Write all values contained in the provided readerprivate OnHeapHnswGraph
writeGraph
(RandomAccessVectorValuesProducer vectorValues, VectorSimilarityFunction similarityFunction) private void
writeMeta
(FieldInfo field, long vectorDataOffset, long vectorDataLength, long vectorIndexOffset, long vectorIndexLength, DocsWithFieldSet docsWithField, OnHeapHnswGraph graph) private static DocsWithFieldSet
writeVectorData
(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:KnnVectorsWriter
Write all values contained in the provided reader- Specified by:
writeField
in 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:KnnVectorsWriter
Called once at the end before close- Specified by:
finish
in classKnnVectorsWriter
- Throws:
IOException
-
close
- Throws:
IOException
-