Module org.apache.lucene.core
Package org.apache.lucene.util.hnsw
Interface RandomAccessVectorValues<T>
- All Known Implementing Classes:
Lucene90HnswVectorsReader.OffHeapFloatVectorValues,Lucene91HnswVectorsReader.OffHeapFloatVectorValues,Lucene95HnswVectorsWriter.RAVectorValues,OffHeapByteVectorValues,OffHeapByteVectorValues,OffHeapByteVectorValues.DenseOffHeapVectorValues,OffHeapByteVectorValues.DenseOffHeapVectorValues,OffHeapByteVectorValues.EmptyOffHeapVectorValues,OffHeapByteVectorValues.EmptyOffHeapVectorValues,OffHeapByteVectorValues.SparseOffHeapVectorValues,OffHeapByteVectorValues.SparseOffHeapVectorValues,OffHeapFloatVectorValues,OffHeapFloatVectorValues,OffHeapFloatVectorValues,OffHeapFloatVectorValues.DenseOffHeapVectorValues,OffHeapFloatVectorValues.DenseOffHeapVectorValues,OffHeapFloatVectorValues.DenseOffHeapVectorValues,OffHeapFloatVectorValues.EmptyOffHeapVectorValues,OffHeapFloatVectorValues.EmptyOffHeapVectorValues,OffHeapFloatVectorValues.EmptyOffHeapVectorValues,OffHeapFloatVectorValues.SparseOffHeapVectorValues,OffHeapFloatVectorValues.SparseOffHeapVectorValues,OffHeapFloatVectorValues.SparseOffHeapVectorValues,SimpleTextKnnVectorsReader.SimpleTextByteVectorValues,SimpleTextKnnVectorsReader.SimpleTextFloatVectorValues
public interface RandomAccessVectorValues<T>
Provides random access to vectors by dense ordinal. This interface is used by HNSW-based
implementations of KNN search.
-
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a new copy of thisRandomAccessVectorValues.intReturn the dimension of the returned vector valuesintsize()Return the number of vector valuesvectorValue(int targetOrd) Return the vector value indexed at the given ordinal.
-
Method Details
-
size
int size()Return the number of vector values -
dimension
int dimension()Return the dimension of the returned vector values -
vectorValue
Return the vector value indexed at the given ordinal.- Parameters:
targetOrd- a valid ordinal, ≥ 0 and <size().- Throws:
IOException
-
copy
Creates a new copy of thisRandomAccessVectorValues. This is helpful when you need to access different values at once, to avoid overwriting the underlying float vector returned byvectorValue(int).- Throws:
IOException
-