Module org.apache.lucene.core
Class OffHeapQuantizedByteVectorValues
java.lang.Object
org.apache.lucene.search.DocIdSetIterator
org.apache.lucene.index.ByteVectorValues
org.apache.lucene.codecs.lucene99.QuantizedByteVectorValues
org.apache.lucene.codecs.lucene99.OffHeapQuantizedByteVectorValues
- All Implemented Interfaces:
RandomAccessQuantizedByteVectorValues,RandomAccessVectorValues<byte[]>
- Direct Known Subclasses:
OffHeapQuantizedByteVectorValues.DenseOffHeapVectorValues,OffHeapQuantizedByteVectorValues.EmptyOffHeapVectorValues,OffHeapQuantizedByteVectorValues.SparseOffHeapVectorValues
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 TypeClassDescription(package private) static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final byte[]protected final ByteBufferprotected final intprotected final intprotected intprotected final float[]protected final intprotected final IndexInputFields inherited from class org.apache.lucene.search.DocIdSetIterator
NO_MORE_DOCS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturn the dimension of the vectorsfloat(package private) static OffHeapQuantizedByteVectorValuesload(OrdToDocDISIReaderConfiguration configuration, int dimension, int size, 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.index.ByteVectorValues
cost, 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.codecs.lucene99.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 -
slice
-
binaryValue
protected final byte[] binaryValue -
byteBuffer
-
byteSize
protected final int byteSize -
lastOrd
protected int lastOrd -
scoreCorrectionConstant
protected final float[] scoreCorrectionConstant
-
-
Constructor Details
-
OffHeapQuantizedByteVectorValues
OffHeapQuantizedByteVectorValues(int dimension, int size, IndexInput slice)
-
-
Method Details
-
dimension
public int dimension()Description copied from class:ByteVectorValuesReturn the dimension of the vectors- Specified by:
dimensionin interfaceRandomAccessVectorValues<byte[]>- Specified by:
dimensionin classByteVectorValues
-
size
public int size()Description copied from class:ByteVectorValuesReturn the number of vectors for this field.- Specified by:
sizein interfaceRandomAccessVectorValues<byte[]>- Specified by:
sizein classByteVectorValues- Returns:
- the number of vectors returned by this iterator
-
vectorValue
Description copied from interface:RandomAccessVectorValuesReturn the vector value indexed at the given ordinal.- Specified by:
vectorValuein interfaceRandomAccessVectorValues<byte[]>- Parameters:
targetOrd- a valid ordinal, ≥ 0 and <RandomAccessVectorValues.size().- Throws:
IOException
-
getScoreCorrectionConstant
public float getScoreCorrectionConstant()- Specified by:
getScoreCorrectionConstantin interfaceRandomAccessQuantizedByteVectorValues- Specified by:
getScoreCorrectionConstantin classQuantizedByteVectorValues
-
load
static OffHeapQuantizedByteVectorValues load(OrdToDocDISIReaderConfiguration configuration, int dimension, int size, long quantizedVectorDataOffset, long quantizedVectorDataLength, IndexInput vectorData) throws IOException - Throws:
IOException
-