Class OffHeapByteVectorValues
java.lang.Object
org.apache.lucene.index.KnnVectorValues
org.apache.lucene.index.ByteVectorValues
org.apache.lucene.backward_codecs.lucene94.OffHeapByteVectorValues
- Direct Known Subclasses:
OffHeapByteVectorValues.DenseOffHeapVectorValues
,OffHeapByteVectorValues.EmptyOffHeapVectorValues
,OffHeapByteVectorValues.SparseOffHeapVectorValues
Read the vector values from the index input. This supports both iterated and random access.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
private static class
private static class
Nested classes/interfaces inherited from class org.apache.lucene.index.KnnVectorValues
KnnVectorValues.DocIndexIterator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final byte[]
protected final ByteBuffer
protected final int
protected final int
protected int
protected final int
protected final IndexInput
protected final VectorSimilarityFunction
-
Constructor Summary
ConstructorsConstructorDescriptionOffHeapByteVectorValues
(int dimension, int size, IndexInput slice, VectorSimilarityFunction vectorSimilarityFunction, int byteSize) -
Method Summary
Modifier and TypeMethodDescriptionint
Return the dimension of the vectors(package private) static OffHeapByteVectorValues
load
(Lucene94HnswVectorsReader.FieldEntry fieldEntry, IndexInput vectorData) private void
readValue
(int targetOrd) int
size()
Return the number of vectors for this field.byte[]
vectorValue
(int targetOrd) Return the vector value for the given vector ordinal which must be in [0, size() - 1], otherwise IndexOutOfBoundsException is thrown.Methods inherited from class org.apache.lucene.index.ByteVectorValues
checkField, copy, fromBytes, getEncoding, scorer
Methods inherited from class org.apache.lucene.index.KnnVectorValues
createDenseIterator, createSparseIterator, fromDISI, getAcceptOrds, getVectorByteLength, iterator, ordToDoc
-
Field Details
-
dimension
protected final int dimension -
size
protected final int size -
slice
-
lastOrd
protected int lastOrd -
binaryValue
protected final byte[] binaryValue -
byteBuffer
-
byteSize
protected final int byteSize -
vectorSimilarityFunction
-
-
Constructor Details
-
OffHeapByteVectorValues
OffHeapByteVectorValues(int dimension, int size, IndexInput slice, VectorSimilarityFunction vectorSimilarityFunction, int byteSize)
-
-
Method Details
-
dimension
public int dimension()Description copied from class:KnnVectorValues
Return the dimension of the vectors- Specified by:
dimension
in classKnnVectorValues
-
size
public int size()Description copied from class:KnnVectorValues
Return the number of vectors for this field.- Specified by:
size
in classKnnVectorValues
- Returns:
- the number of vectors returned by this iterator
-
vectorValue
Description copied from class:ByteVectorValues
Return the vector value for the given vector ordinal which must be in [0, size() - 1], otherwise IndexOutOfBoundsException is thrown. The returned array may be shared across calls.- Specified by:
vectorValue
in classByteVectorValues
- Returns:
- the vector value
- Throws:
IOException
-
readValue
- Throws:
IOException
-
load
static OffHeapByteVectorValues load(Lucene94HnswVectorsReader.FieldEntry fieldEntry, IndexInput vectorData) throws IOException - Throws:
IOException
-