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,Lucene99HnswVectorsWriter
public abstract class KnnVectorsWriter extends Object implements Accountable, Closeable
Writes vectors to an index.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKnnVectorsWriter.MergedVectorValuesView over multiple vector values supporting iterator-style access via DocIdMerger.
-
Field Summary
-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedKnnVectorsWriter()Sole constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract KnnFieldVectorsWriter<?>addField(FieldInfo fieldInfo)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 *voidmerge(MergeState mergeState)Merges the segment vectors for all fields.voidmergeOneField(FieldInfo fieldInfo, MergeState mergeState)Write field for merging-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsed
-
-
-
-
Method Detail
-
addField
public abstract KnnFieldVectorsWriter<?> addField(FieldInfo fieldInfo) throws IOException
Add new field for indexing- Throws:
IOException
-
flush
public abstract void flush(int maxDoc, Sorter.DocMap sortMap) throws IOExceptionFlush all buffered data on disk *- Throws:
IOException
-
mergeOneField
public void mergeOneField(FieldInfo fieldInfo, MergeState mergeState) throws IOException
Write field for merging- Throws:
IOException
-
finish
public abstract void finish() throws IOExceptionCalled once at the end before close- Throws:
IOException
-
merge
public final void merge(MergeState mergeState) throws IOException
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
-
-