Package org.apache.lucene.codecs
Class KnnVectorsWriter
java.lang.Object
org.apache.lucene.codecs.KnnVectorsWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,Accountable
- Direct Known Subclasses:
BufferingKnnVectorsWriter,Lucene94HnswVectorsWriter,PerFieldKnnVectorsFormat.FieldsWriter
Writes vectors to an index.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classView over multiple VectorValues supporting iterator-style access via DocIdMerger.private static classTracks state of one sub-reader that we are merging -
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract KnnFieldVectorsWriter<?>Add new field for indexingabstract voidfinish()Called once at the end before closeabstract voidflush(int maxDoc, Sorter.DocMap sortMap) Flush all buffered data on disk *final voidmerge(MergeState mergeState) Merges the segment vectors for all fields.<T> voidmergeOneField(FieldInfo fieldInfo, MergeState mergeState) Write field for mergingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsed
-
Constructor Details
-
KnnVectorsWriter
protected KnnVectorsWriter()Sole constructor
-
-
Method Details
-
addField
Add new field for indexing- Throws:
IOException
-
flush
Flush all buffered data on disk *- Throws:
IOException
-
mergeOneField
Write field for merging- Throws:
IOException
-
finish
Called once at the end before close- Throws:
IOException
-
merge
Merges the segment vectors for all fields. This default implementation delegates tomergeOneField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState), passing aKnnVectorsReaderthat combines the vector values and ignores deleted documents.- Throws:
IOException
-