Module org.apache.lucene.core
Class OffHeapFloatVectorValues
java.lang.Object
org.apache.lucene.index.KnnVectorValues
org.apache.lucene.index.FloatVectorValues
org.apache.lucene.codecs.lucene95.OffHeapFloatVectorValues
- All Implemented Interfaces:
HasIndexSlice
- 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 TypeClassDescriptionstatic class
Dense vector values that are stored off-heap.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 int
protected final int
protected final FlatVectorsScorer
protected int
protected final VectorSimilarityFunction
protected final int
protected final IndexInput
protected final float[]
-
Constructor Summary
ConstructorsConstructorDescriptionOffHeapFloatVectorValues
(int dimension, int size, IndexInput slice, int byteSize, FlatVectorsScorer flatVectorsScorer, VectorSimilarityFunction similarityFunction) -
Method Summary
Modifier and TypeMethodDescriptionint
Return the dimension of the vectorsgetSlice()
Returns an IndexInput from which to read this instance's values.static OffHeapFloatVectorValues
load
(VectorSimilarityFunction vectorSimilarityFunction, FlatVectorsScorer flatVectorsScorer, OrdToDocDISIReaderConfiguration configuration, VectorEncoding vectorEncoding, int dimension, long vectorDataOffset, long vectorDataLength, IndexInput vectorData) int
size()
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, 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
-
byteSize
protected final int byteSize -
lastOrd
protected int lastOrd -
value
protected final float[] value -
similarityFunction
-
flatVectorsScorer
-
-
Constructor Details
-
OffHeapFloatVectorValues
OffHeapFloatVectorValues(int dimension, int size, IndexInput slice, int byteSize, FlatVectorsScorer flatVectorsScorer, VectorSimilarityFunction similarityFunction)
-
-
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
-
getSlice
Description copied from interface:HasIndexSlice
Returns an IndexInput from which to read this instance's values.- Specified by:
getSlice
in interfaceHasIndexSlice
-
vectorValue
Description copied from class:FloatVectorValues
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 classFloatVectorValues
- Returns:
- the vector value
- Throws:
IOException
-
load
public static OffHeapFloatVectorValues load(VectorSimilarityFunction vectorSimilarityFunction, FlatVectorsScorer flatVectorsScorer, OrdToDocDISIReaderConfiguration configuration, VectorEncoding vectorEncoding, int dimension, long vectorDataOffset, long vectorDataLength, IndexInput vectorData) throws IOException - Throws:
IOException
-