Package org.apache.lucene.index
Class VectorValuesWriter
java.lang.Object
org.apache.lucene.index.VectorValuesWriter
Buffers up pending vector value(s) per doc, then flushes when segment flushes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long
private final DocsWithFieldSet
private final FieldInfo
private final Counter
private int
private final List<float[]>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addValue
(int docID, float[] vectorValue) Adds a value for the given document.void
flush
(Sorter.DocMap sortMap, KnnVectorsWriter knnVectorsWriter) Flush this field's values to storage, sorting the values in accordance with sortMapprivate void
-
Field Details
-
fieldInfo
-
iwBytesUsed
-
vectors
-
docsWithField
-
lastDocID
private int lastDocID -
bytesUsed
private long bytesUsed
-
-
Constructor Details
-
VectorValuesWriter
-
-
Method Details
-
addValue
public void addValue(int docID, float[] vectorValue) Adds a value for the given document. Only a single value may be added.- Parameters:
docID
- the value is added to this documentvectorValue
- the value to add- Throws:
IllegalArgumentException
- if a value has already been added to the given document
-
updateBytesUsed
private void updateBytesUsed() -
flush
Flush this field's values to storage, sorting the values in accordance with sortMap- Parameters:
sortMap
- specifies the order of documents being flushed, or null if they are to be flushed in docid orderknnVectorsWriter
- the Codec's vector writer that handles the actual encoding and I/O- Throws:
IOException
- if there is an error writing the field and its values
-