java.lang.Object
org.apache.lucene.codecs.KnnVectorsWriter
org.apache.lucene.codecs.BufferingKnnVectorsWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,Accountable
- Direct Known Subclasses:
SimpleTextKnnVectorsWriter
Buffers up pending vector value(s) per doc, then flushes when segment flushes. Used for
SimpleTextKnnVectorsWriter and for vectors writers before v 9.3 .-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static classprivate static classSorting FloatVectorValues that iterate over documents in the order of the provided sortMapprivate static classSorting FloatVectorValues that iterate over documents in the order of the provided sortMapNested classes/interfaces inherited from class org.apache.lucene.codecs.KnnVectorsWriter
KnnVectorsWriter.MergedVectorValues -
Field Summary
FieldsFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd new field for indexingvoidflush(int maxDoc, Sorter.DocMap sortMap) Flush all buffered data on disk *voidmergeOneField(FieldInfo fieldInfo, MergeState mergeState) Write field for merginglongReturn the memory usage of this object in bytes.protected abstract voidwriteField(FieldInfo fieldInfo, ByteVectorValues byteVectorValues, int maxDoc) Write the provided byte vector fieldprotected abstract voidwriteField(FieldInfo fieldInfo, FloatVectorValues floatVectorValues, int maxDoc) Write the provided float vector fieldMethods inherited from class org.apache.lucene.codecs.KnnVectorsWriter
finish, mergeMethods 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
-
Field Details
-
fields
-
-
Constructor Details
-
BufferingKnnVectorsWriter
protected BufferingKnnVectorsWriter()Sole constructor
-
-
Method Details
-
addField
Description copied from class:KnnVectorsWriterAdd new field for indexing- Specified by:
addFieldin classKnnVectorsWriter- Throws:
IOException
-
flush
Description copied from class:KnnVectorsWriterFlush all buffered data on disk *- Specified by:
flushin classKnnVectorsWriter- Throws:
IOException
-
ramBytesUsed
public long ramBytesUsed()Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal. -
mergeOneField
Description copied from class:KnnVectorsWriterWrite field for merging- Overrides:
mergeOneFieldin classKnnVectorsWriter- Throws:
IOException
-
writeField
protected abstract void writeField(FieldInfo fieldInfo, FloatVectorValues floatVectorValues, int maxDoc) throws IOException Write the provided float vector field- Throws:
IOException
-
writeField
protected abstract void writeField(FieldInfo fieldInfo, ByteVectorValues byteVectorValues, int maxDoc) throws IOException Write the provided byte vector field- Throws:
IOException
-