Class Lucene102BinaryQuantizedVectorsReader
java.lang.Object
org.apache.lucene.codecs.KnnVectorsReader
org.apache.lucene.codecs.hnsw.FlatVectorsReader
org.apache.lucene.backward_codecs.lucene102.Lucene102BinaryQuantizedVectorsReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Accountable,QuantizedVectorsReader
public class Lucene102BinaryQuantizedVectorsReader
extends FlatVectorsReader
implements QuantizedVectorsReader
Reader for binary quantized vectors in the Lucene 10.2 format.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classBinarized vector values holding row and quantized vector values -
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLucene102BinaryQuantizedVectorsReader(Lucene102BinaryQuantizedVectorsReader reader, FlatVectorsReader rawVectorsReader) Copy constructor forgetMergeInstance(): the copy sharesreader's open state and reads raw vectors throughrawVectorsReader, normally the original raw reader's merge instance.Lucene102BinaryQuantizedVectorsReader(SegmentReadState state, FlatVectorsReader rawVectorsReader, Lucene102BinaryFlatVectorsScorer vectorsScorer) Creates a new reader for binary quantized vectors. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()voidgetByteVectorValues(String field) getFlatVectorScorer(String field) getFloatVectorValues(String field) getFloatVectorValues(String field, DataAccessHint access) Returns a copy of this reader that reads raw vectors through the raw reader's merge instance.getOffHeapByteSize(FieldInfo fieldInfo) getQuantizationState(String fieldName) getQuantizedVectorValues(String fieldName) getRandomVectorScorer(String field, byte[] target) getRandomVectorScorer(String field, float[] target) getRandomVectorScorerSupplierForMerge(FieldInfo fieldInfo, SegmentWriteState segmentWriteState) intgetVectorCount(FieldInfo fieldInfo) longvoidsearch(String field, byte[] target, KnnCollector knnCollector, AcceptDocs acceptDocs) voidsearch(String field, float[] target, KnnCollector knnCollector, AcceptDocs acceptDocs) Methods inherited from class org.apache.lucene.codecs.KnnVectorsReader
mergeOffHeapByteSizeMapsMethods 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
-
Constructor Details
-
Lucene102BinaryQuantizedVectorsReader
public Lucene102BinaryQuantizedVectorsReader(SegmentReadState state, FlatVectorsReader rawVectorsReader, Lucene102BinaryFlatVectorsScorer vectorsScorer) throws IOException Creates a new reader for binary quantized vectors.- Parameters:
state- the segment read staterawVectorsReader- the reader for the raw (non-quantized) vectorsvectorsScorer- the scorer for binary quantized vectors- Throws:
IOException- if an I/O error occurs
-
Lucene102BinaryQuantizedVectorsReader
protected Lucene102BinaryQuantizedVectorsReader(Lucene102BinaryQuantizedVectorsReader reader, FlatVectorsReader rawVectorsReader) Copy constructor forgetMergeInstance(): the copy sharesreader's open state and reads raw vectors throughrawVectorsReader, normally the original raw reader's merge instance. It is used only by the merging thread and is never closed:finishMerge()releases the raw merge instance.
-
-
Method Details
-
getMergeInstance
Returns a copy of this reader that reads raw vectors through the raw reader's merge instance. A subclass must override this method and build its own copy through thecopy constructor, or its merge instance will be a plainLucene102BinaryQuantizedVectorsReader.- Overrides:
getMergeInstancein classFlatVectorsReader- Throws:
IOException
-
finishMerge
- Overrides:
finishMergein classKnnVectorsReader- Throws:
IOException
-
getFlatVectorScorer
- Specified by:
getFlatVectorScorerin classFlatVectorsReader- Throws:
IOException
-
getRandomVectorScorer
- Specified by:
getRandomVectorScorerin classFlatVectorsReader- Throws:
IOException
-
getRandomVectorScorer
- Specified by:
getRandomVectorScorerin classFlatVectorsReader- Throws:
IOException
-
checkIntegrity
- Specified by:
checkIntegrityin classKnnVectorsReader- Throws:
IOException
-
getFloatVectorValues
public Lucene102BinaryQuantizedVectorsReader.BinarizedVectorValues getFloatVectorValues(String field) throws IOException - Specified by:
getFloatVectorValuesin classKnnVectorsReader- Throws:
IOException
-
getFloatVectorValues
public Lucene102BinaryQuantizedVectorsReader.BinarizedVectorValues getFloatVectorValues(String field, DataAccessHint access) throws IOException - Overrides:
getFloatVectorValuesin classKnnVectorsReader- Throws:
IOException
-
getByteVectorValues
- Specified by:
getByteVectorValuesin classKnnVectorsReader- Throws:
IOException
-
search
public void search(String field, byte[] target, KnnCollector knnCollector, AcceptDocs acceptDocs) throws IOException - Overrides:
searchin classFlatVectorsReader- Throws:
IOException
-
search
public void search(String field, float[] target, KnnCollector knnCollector, AcceptDocs acceptDocs) throws IOException - Overrides:
searchin classFlatVectorsReader- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsedin interfaceAccountable
-
getOffHeapByteSize
- Overrides:
getOffHeapByteSizein classKnnVectorsReader
-
getVectorCount
- Overrides:
getVectorCountin classKnnVectorsReader- Throws:
IOException
-
getQuantizedVectorValues
- Specified by:
getQuantizedVectorValuesin interfaceQuantizedVectorsReader
-
getQuantizationState
- Specified by:
getQuantizationStatein interfaceQuantizedVectorsReader
-
getRandomVectorScorerSupplierForMerge
public CloseableRandomVectorScorerSupplier getRandomVectorScorerSupplierForMerge(FieldInfo fieldInfo, SegmentWriteState segmentWriteState) throws IOException - Specified by:
getRandomVectorScorerSupplierForMergein interfaceQuantizedVectorsReader- Throws:
IOException
-