Class Lucene102BinaryQuantizedVectorsWriter
java.lang.Object
org.apache.lucene.codecs.KnnVectorsWriter
org.apache.lucene.codecs.hnsw.FlatVectorsWriter
org.apache.lucene.codecs.lucene102.Lucene102BinaryQuantizedVectorsWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Accountable
Copied from Lucene, replace with Lucene's implementation sometime after Lucene 10
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.codecs.KnnVectorsWriter
KnnVectorsWriter.MergedVectorValues
-
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Lucene102BinaryQuantizedVectorsWriter
(Lucene102BinaryFlatVectorsScorer vectorsScorer, FlatVectorsWriter rawVectorDelegate, SegmentWriteState state) Sole constructor -
Method Summary
Modifier and TypeMethodDescriptionAdd a new field for indexingvoid
close()
void
finish()
Called once at the end before closevoid
flush
(int maxDoc, Sorter.DocMap sortMap) Flush all buffered data on disk *void
mergeOneField
(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.long
Return the memory usage of this object in bytes.Methods inherited from class org.apache.lucene.codecs.hnsw.FlatVectorsWriter
getFlatVectorScorer
Methods inherited from class org.apache.lucene.codecs.KnnVectorsWriter
mapOldOrdToNewOrd, merge
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
-
Constructor Details
-
Lucene102BinaryQuantizedVectorsWriter
protected Lucene102BinaryQuantizedVectorsWriter(Lucene102BinaryFlatVectorsScorer vectorsScorer, FlatVectorsWriter rawVectorDelegate, SegmentWriteState state) throws IOException Sole constructor- Parameters:
vectorsScorer
- the scorer to use for scoring vectors- Throws:
IOException
-
-
Method Details
-
addField
Description copied from class:FlatVectorsWriter
Add a new field for indexing- Specified by:
addField
in classFlatVectorsWriter
- Parameters:
fieldInfo
- fieldInfo of the field to add- Returns:
- a writer for the field
- Throws:
IOException
- if an I/O error occurs when adding the field
-
flush
Description copied from class:KnnVectorsWriter
Flush all buffered data on disk *- Specified by:
flush
in classKnnVectorsWriter
- Throws:
IOException
-
finish
Description copied from class:KnnVectorsWriter
Called once at the end before close- Specified by:
finish
in classKnnVectorsWriter
- Throws:
IOException
-
mergeOneField
Description copied from class:KnnVectorsWriter
Write field for merging- Overrides:
mergeOneField
in classKnnVectorsWriter
- Throws:
IOException
-
mergeOneFieldToIndex
public CloseableRandomVectorScorerSupplier mergeOneFieldToIndex(FieldInfo fieldInfo, MergeState mergeState) throws IOException Description copied from class:FlatVectorsWriter
Write 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:
mergeOneFieldToIndex
in 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
-
ramBytesUsed
public long ramBytesUsed()Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.
-