Class OffHeapFloatVectorValues
- java.lang.Object
-
- org.apache.lucene.search.DocIdSetIterator
-
- org.apache.lucene.index.FloatVectorValues
-
- org.apache.lucene.codecs.lucene95.OffHeapFloatVectorValues
-
- All Implemented Interfaces:
RandomAccessVectorValues,RandomAccessVectorValues.Floats
- Direct Known Subclasses:
OffHeapFloatVectorValues.DenseOffHeapVectorValues
public abstract class OffHeapFloatVectorValues extends FloatVectorValues implements RandomAccessVectorValues.Floats
Read the vector values from the index input. This supports both iterated and random access.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOffHeapFloatVectorValues.DenseOffHeapVectorValuesDense 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
Fields Modifier and Type Field Description protected intbyteSizeprotected intdimensionprotected FlatVectorsScorerflatVectorsScorerprotected intlastOrdprotected VectorSimilarityFunctionsimilarityFunctionprotected intsizeprotected IndexInputsliceprotected float[]value-
Fields inherited from class org.apache.lucene.search.DocIdSetIterator
NO_MORE_DOCS
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intdimension()Return the dimension of the vectorsIndexInputgetSlice()Returns a slice of the underlyingIndexInputthat contains the vector values if availablestatic OffHeapFloatVectorValuesload(VectorSimilarityFunction vectorSimilarityFunction, FlatVectorsScorer flatVectorsScorer, OrdToDocDISIReaderConfiguration configuration, VectorEncoding vectorEncoding, int dimension, long vectorDataOffset, long vectorDataLength, IndexInput vectorData)intsize()Return the number of vectors for this field.float[]vectorValue(int targetOrd)Return the vector value indexed at the given ordinal.-
Methods inherited from class org.apache.lucene.index.FloatVectorValues
checkField, cost, scorer, vectorValue
-
Methods inherited from class org.apache.lucene.search.DocIdSetIterator
advance, all, docID, empty, nextDoc, range, slowAdvance
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues
getAcceptOrds, ordToDoc
-
Methods inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues.Floats
copy, getVectorByteLength
-
-
-
-
Field Detail
-
dimension
protected final int dimension
-
size
protected final int size
-
slice
protected final IndexInput slice
-
byteSize
protected final int byteSize
-
lastOrd
protected int lastOrd
-
value
protected final float[] value
-
similarityFunction
protected final VectorSimilarityFunction similarityFunction
-
flatVectorsScorer
protected final FlatVectorsScorer flatVectorsScorer
-
-
Method Detail
-
dimension
public int dimension()
Description copied from class:FloatVectorValuesReturn the dimension of the vectors- Specified by:
dimensionin interfaceRandomAccessVectorValues- Specified by:
dimensionin classFloatVectorValues
-
size
public int size()
Description copied from class:FloatVectorValuesReturn the number of vectors for this field.- Specified by:
sizein interfaceRandomAccessVectorValues- Specified by:
sizein classFloatVectorValues- Returns:
- the number of vectors returned by this iterator
-
getSlice
public IndexInput getSlice()
Description copied from interface:RandomAccessVectorValuesReturns a slice of the underlyingIndexInputthat contains the vector values if available- Specified by:
getSlicein interfaceRandomAccessVectorValues
-
vectorValue
public float[] vectorValue(int targetOrd) throws IOExceptionDescription copied from interface:RandomAccessVectorValues.FloatsReturn the vector value indexed at the given ordinal.- Specified by:
vectorValuein interfaceRandomAccessVectorValues.Floats- Parameters:
targetOrd- a valid ordinal, ≥ 0 and <RandomAccessVectorValues.size().- 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
-
-