Package org.apache.lucene.index
Interface RandomAccessVectorValues
-
- All Known Implementing Classes:
Lucene90HnswVectorsReader.OffHeapVectorValues,Lucene91HnswVectorsReader.OffHeapVectorValues,OffHeapVectorValues,OffHeapVectorValues.DenseOffHeapVectorValues,OffHeapVectorValues.EmptyOffHeapVectorValues,OffHeapVectorValues.SparseOffHeapVectorValues,SimpleTextKnnVectorsReader.SimpleTextVectorValues,VectorValuesWriter.BufferedVectorValues
public interface RandomAccessVectorValuesProvides random access to vectors by dense ordinal.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BytesRefbinaryValue(int targetOrd)Return the vector indexed at the given ordinal value as an array of bytes in a BytesRef; these are the bytes corresponding to the float array.intdimension()Return the dimension of the returned vector valuesintsize()Return the number of vector valuesfloat[]vectorValue(int targetOrd)Return the vector value indexed at the given ordinal.
-
-
-
Method Detail
-
size
int size()
Return the number of vector values
-
dimension
int dimension()
Return the dimension of the returned vector values
-
vectorValue
float[] vectorValue(int targetOrd) throws java.io.IOExceptionReturn the vector value indexed at the given ordinal. The provided floating point array may be shared and overwritten by subsequent calls to this method andbinaryValue(int).- Parameters:
targetOrd- a valid ordinal, ≥ 0 and <size().- Throws:
java.io.IOException
-
binaryValue
BytesRef binaryValue(int targetOrd) throws java.io.IOException
Return the vector indexed at the given ordinal value as an array of bytes in a BytesRef; these are the bytes corresponding to the float array. The provided bytes may be shared and overwritten by subsequent calls to this method andvectorValue(int).- Parameters:
targetOrd- a valid ordinal, ≥ 0 and <size().- Throws:
java.io.IOException
-
-