Class Lucene99FlatVectorsWriter
java.lang.Object
org.apache.lucene.codecs.FlatVectorsWriter
org.apache.lucene.codecs.lucene99.Lucene99FlatVectorsWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,Accountable
Writes vector values to index segments.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Method Summary
Modifier and TypeMethodDescriptionaddField(FieldInfo fieldInfo, KnnFieldVectorsWriter<?> indexWriter) Add a new field for indexing, allowing the user to provide a writer that the flat vectors writer can delegate to if additional indexing logic is required.voidclose()voidfinish()Called once at the end before closevoidflush(int maxDoc, Sorter.DocMap sortMap) Flush all buffered data on disk *voidmergeOneField(FieldInfo fieldInfo, MergeState mergeState) Write field for mergingmergeOneFieldToIndex(FieldInfo fieldInfo, MergeState mergeState) Write the field for merging, providing a scorer over the newly merged flat vectors.longReturn the memory usage of this object in bytes.Methods 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
-
Method Details
-
addField
public FlatFieldVectorsWriter<?> addField(FieldInfo fieldInfo, KnnFieldVectorsWriter<?> indexWriter) throws IOException Description copied from class:FlatVectorsWriterAdd a new field for indexing, allowing the user to provide a writer that the flat vectors writer can delegate to if additional indexing logic is required.- Specified by:
addFieldin classFlatVectorsWriter- Parameters:
fieldInfo- fieldInfo of the field to addindexWriter- the writer to delegate to, can be null- Returns:
- a writer for the field
- Throws:
IOException- if an I/O error occurs when adding the field
-
flush
Description copied from class:FlatVectorsWriterFlush all buffered data on disk *- Specified by:
flushin classFlatVectorsWriter- Throws:
IOException
-
finish
Description copied from class:FlatVectorsWriterCalled once at the end before close- Specified by:
finishin classFlatVectorsWriter- 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:FlatVectorsWriterWrite field for merging- Overrides:
mergeOneFieldin classFlatVectorsWriter- Throws:
IOException
-
mergeOneFieldToIndex
public CloseableRandomVectorScorerSupplier mergeOneFieldToIndex(FieldInfo fieldInfo, MergeState mergeState) throws IOException Description copied from class:FlatVectorsWriterWrite the field for merging, providing a scorer over the newly merged flat vectors. This way any additional merging logic can be implemented by the user of this class.- Specified by:
mergeOneFieldToIndexin classFlatVectorsWriter- Parameters:
fieldInfo- fieldInfo of the field to mergemergeState- mergeState of the segments to merge- Returns:
- a scorer over the newly merged flat vectors, which should be closed as it holds a temporary file handle to read over the newly merged vectors
- Throws:
IOException- if an I/O error occurs when merging
-
close
- Throws:
IOException
-