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 classView over multiple VectorValues supporting iterator-style access via DocIdMerger.private static classTracks state of one sub-reader that we are merging -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidfinish()Called once at the end before closevoidmerge(MergeState mergeState) Merges the segment vectors for all fields.abstract voidwriteField(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 aKnnVectorsReaderthat combines the vector values and ignores deleted documents.- Throws:
IOException
-