Class OffHeapFloatVectorValues
java.lang.Object
org.apache.lucene.index.KnnVectorValues
org.apache.lucene.index.FloatVectorValues
org.apache.lucene.backward_codecs.lucene94.OffHeapFloatVectorValues
- Direct Known Subclasses:
OffHeapFloatVectorValues.DenseOffHeapVectorValues,OffHeapFloatVectorValues.EmptyOffHeapVectorValues,OffHeapFloatVectorValues.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 classprivate static classprivate static classNested classes/interfaces inherited from class org.apache.lucene.index.KnnVectorValues
KnnVectorValues.DocIndexIterator -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final intprotected intprotected final intprotected final IndexInputprotected final float[]protected final VectorSimilarityFunction -
Constructor Summary
ConstructorsConstructorDescriptionOffHeapFloatVectorValues(int dimension, int size, IndexInput slice, VectorSimilarityFunction vectorSimilarityFunction, int byteSize) -
Method Summary
Modifier and TypeMethodDescriptionintReturn the dimension of the vectors(package private) static OffHeapFloatVectorValuesload(Lucene94HnswVectorsReader.FieldEntry fieldEntry, IndexInput vectorData) intsize()Return the number of vectors for this field.float[]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.FloatVectorValues
checkField, copy, fromFloats, getEncoding, scorerMethods 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
-
byteSize
protected final int byteSize -
lastOrd
protected int lastOrd -
value
protected final float[] value -
vectorSimilarityFunction
-
-
Constructor Details
-
OffHeapFloatVectorValues
OffHeapFloatVectorValues(int dimension, int size, IndexInput slice, VectorSimilarityFunction vectorSimilarityFunction, int byteSize)
-
-
Method Details
-
dimension
public int dimension()Description copied from class:KnnVectorValuesReturn the dimension of the vectors- Specified by:
dimensionin classKnnVectorValues
-
size
public int size()Description copied from class:KnnVectorValuesReturn the number of vectors for this field.- Specified by:
sizein classKnnVectorValues- Returns:
- the number of vectors returned by this iterator
-
vectorValue
Description copied from class:FloatVectorValuesReturn 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:
vectorValuein classFloatVectorValues- Returns:
- the vector value
- Throws:
IOException
-
load
static OffHeapFloatVectorValues load(Lucene94HnswVectorsReader.FieldEntry fieldEntry, IndexInput vectorData) throws IOException - Throws:
IOException
-