Package org.apache.lucene.codecs
Class KnnVectorsWriter
java.lang.Object
org.apache.lucene.codecs.KnnVectorsWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
Lucene92HnswVectorsWriter
,PerFieldKnnVectorsFormat.FieldsWriter
,SimpleTextKnnVectorsWriter
Writes vectors to an index.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
View over multiple VectorValues supporting iterator-style access via DocIdMerger.private static class
Tracks state of one sub-reader that we are merging -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
finish()
Called once at the end before closevoid
merge
(MergeState mergeState) Merges the segment vectors for all fields.abstract void
writeField
(FieldInfo fieldInfo, KnnVectorsReader knnVectorsReader) Write all values contained in the provided reader
-
Constructor Details
-
KnnVectorsWriter
protected KnnVectorsWriter()Sole constructor
-
-
Method Details
-
writeField
public abstract void writeField(FieldInfo fieldInfo, KnnVectorsReader knnVectorsReader) throws IOException Write all values contained in the provided reader- Throws:
IOException
-
finish
Called once at the end before close- Throws:
IOException
-
merge
Merges the segment vectors for all fields. This default implementation delegates towriteField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.KnnVectorsReader)
, passing aKnnVectorsReader
that combines the vector values and ignores deleted documents.- Throws:
IOException
-