Class OffHeapQuantizedByteVectorValues
java.lang.Object
org.apache.lucene.search.DocIdSetIterator
org.apache.lucene.util.quantization.QuantizedByteVectorValues
org.apache.lucene.codecs.lucene99.OffHeapQuantizedByteVectorValues
- All Implemented Interfaces:
RandomAccessVectorValues,RandomAccessVectorValues.Bytes,RandomAccessQuantizedByteVectorValues
- Direct Known Subclasses:
OffHeapQuantizedByteVectorValues.DenseOffHeapVectorValues
public abstract class OffHeapQuantizedByteVectorValues
extends QuantizedByteVectorValues
implements RandomAccessQuantizedByteVectorValues
Read the quantized vector values and their score correction values from the index input. This
supports both iterated and random access.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDense vector values that are stored off-heap.Nested classes/interfaces inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues
RandomAccessVectorValues.Bytes, RandomAccessVectorValues.Floats -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final byte[]protected final ByteBufferprotected final intprotected final booleanprotected final intprotected intprotected final intprotected final ScalarQuantizerprotected final float[]protected final VectorSimilarityFunctionprotected final intprotected final IndexInputprotected final FlatVectorsScorerFields inherited from class org.apache.lucene.search.DocIdSetIterator
NO_MORE_DOCS -
Method Summary
Modifier and TypeMethodDescriptionintReturn the dimension of the vectorsfloatfloatgetScoreCorrectionConstant(int targetOrd) getSlice()Returns a slice of the underlyingIndexInputthat contains the vector values if availableintReturns the vector byte length, defaults to dimension multiplied by byte sizeload(OrdToDocDISIReaderConfiguration configuration, int dimension, int size, ScalarQuantizer scalarQuantizer, VectorSimilarityFunction similarityFunction, FlatVectorsScorer vectorsScorer, boolean compress, long quantizedVectorDataOffset, long quantizedVectorDataLength, IndexInput vectorData) intsize()Return the number of vectors for this field.byte[]vectorValue(int targetOrd) Return the vector value indexed at the given ordinal.Methods inherited from class org.apache.lucene.util.quantization.QuantizedByteVectorValues
cost, scorer, vectorValueMethods inherited from class org.apache.lucene.search.DocIdSetIterator
advance, all, docID, empty, nextDoc, range, slowAdvanceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.quantization.RandomAccessQuantizedByteVectorValues
copyMethods inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues
getAcceptOrds, ordToDoc
-
Field Details
-
dimension
protected final int dimension -
size
protected final int size -
numBytes
protected final int numBytes -
scalarQuantizer
-
similarityFunction
-
vectorsScorer
-
compress
protected final boolean compress -
slice
-
binaryValue
protected final byte[] binaryValue -
byteBuffer
-
byteSize
protected final int byteSize -
lastOrd
protected int lastOrd -
scoreCorrectionConstant
protected final float[] scoreCorrectionConstant
-
-
Method Details
-
getScalarQuantizer
- Specified by:
getScalarQuantizerin interfaceRandomAccessQuantizedByteVectorValues
-
dimension
public int dimension()Description copied from class:QuantizedByteVectorValuesReturn the dimension of the vectors- Specified by:
dimensionin interfaceRandomAccessVectorValues- Specified by:
dimensionin classQuantizedByteVectorValues
-
size
public int size()Description copied from class:QuantizedByteVectorValuesReturn the number of vectors for this field.- Specified by:
sizein interfaceRandomAccessVectorValues- Specified by:
sizein classQuantizedByteVectorValues- Returns:
- the number of vectors returned by this iterator
-
vectorValue
Description copied from interface:RandomAccessVectorValues.BytesReturn the vector value indexed at the given ordinal.- Specified by:
vectorValuein interfaceRandomAccessVectorValues.Bytes- Parameters:
targetOrd- a valid ordinal, ≥ 0 and <RandomAccessVectorValues.size().- Throws:
IOException
-
getScoreCorrectionConstant
public float getScoreCorrectionConstant()- Specified by:
getScoreCorrectionConstantin classQuantizedByteVectorValues
-
getScoreCorrectionConstant
- Specified by:
getScoreCorrectionConstantin interfaceRandomAccessQuantizedByteVectorValues- Throws:
IOException
-
getSlice
Description copied from interface:RandomAccessVectorValuesReturns a slice of the underlyingIndexInputthat contains the vector values if available- Specified by:
getSlicein interfaceRandomAccessVectorValues
-
getVectorByteLength
public int getVectorByteLength()Description copied from interface:RandomAccessVectorValues.BytesReturns the vector byte length, defaults to dimension multiplied by byte size- Specified by:
getVectorByteLengthin interfaceRandomAccessVectorValues- Specified by:
getVectorByteLengthin interfaceRandomAccessVectorValues.Bytes
-
load
public static OffHeapQuantizedByteVectorValues load(OrdToDocDISIReaderConfiguration configuration, int dimension, int size, ScalarQuantizer scalarQuantizer, VectorSimilarityFunction similarityFunction, FlatVectorsScorer vectorsScorer, boolean compress, long quantizedVectorDataOffset, long quantizedVectorDataLength, IndexInput vectorData) throws IOException - Throws:
IOException
-