Package org.apache.lucene.codecs
Class KnnVectorsWriter
- java.lang.Object
-
- org.apache.lucene.codecs.KnnVectorsWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
Lucene92HnswVectorsWriter
,PerFieldKnnVectorsFormat.FieldsWriter
,SimpleTextKnnVectorsWriter
public abstract class KnnVectorsWriter extends java.lang.Object implements java.io.Closeable
Writes vectors to an index.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
KnnVectorsWriter.MergedVectorValues
View over multiple VectorValues supporting iterator-style access via DocIdMerger.private static class
KnnVectorsWriter.VectorValuesSub
Tracks state of one sub-reader that we are merging
-
Constructor Summary
Constructors Modifier Constructor Description protected
KnnVectorsWriter()
Sole constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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
-
-
-
Method Detail
-
writeField
public abstract void writeField(FieldInfo fieldInfo, KnnVectorsReader knnVectorsReader) throws java.io.IOException
Write all values contained in the provided reader- Throws:
java.io.IOException
-
finish
public abstract void finish() throws java.io.IOException
Called once at the end before close- Throws:
java.io.IOException
-
merge
public void merge(MergeState mergeState) throws java.io.IOException
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:
java.io.IOException
-
-