Module org.elasticsearch.server
Class KmeansFloatVectorValues
java.lang.Object
org.apache.lucene.index.KnnVectorValues
org.apache.lucene.index.FloatVectorValues
org.elasticsearch.index.codec.vectors.cluster.KmeansFloatVectorValues
public final class KmeansFloatVectorValues
extends org.apache.lucene.index.FloatVectorValues
Unified class that can represent on-heap and off-heap vector values.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.index.KnnVectorValues
org.apache.lucene.index.KnnVectorValues.DocIndexIterator -
Method Summary
Modifier and TypeMethodDescriptionstatic KmeansFloatVectorValuesBuild an instance from on-heap data structures.static KmeansFloatVectorValuesbuild(org.apache.lucene.store.IndexInput vectors, org.apache.lucene.store.IndexInput docs, int numVectors, int dims) Builds an instance from off-heap data structures.org.apache.lucene.index.FloatVectorValuescopy()intintordToDoc(int ord) intsize()float[]vectorValue(int ord) Methods inherited from class org.apache.lucene.index.FloatVectorValues
checkField, fromFloats, getEncoding, scorerMethods inherited from class org.apache.lucene.index.KnnVectorValues
createDenseIterator, createSparseIterator, fromDISI, getAcceptOrds, getVectorByteLength, iterator
-
Method Details
-
build
Build an instance from on-heap data structures. -
build
public static KmeansFloatVectorValues build(org.apache.lucene.store.IndexInput vectors, org.apache.lucene.store.IndexInput docs, int numVectors, int dims) throws IOException Builds an instance from off-heap data structures. Vectors are expected to be written as little endian floats one after the other. Docs are expected to be written as little endian ints one after the other.- Throws:
IOException
-
vectorValue
- Specified by:
vectorValuein classorg.apache.lucene.index.FloatVectorValues- Throws:
IOException
-
copy
public org.apache.lucene.index.FloatVectorValues copy()- Specified by:
copyin classorg.apache.lucene.index.FloatVectorValues
-
dimension
public int dimension()- Specified by:
dimensionin classorg.apache.lucene.index.KnnVectorValues
-
size
public int size()- Specified by:
sizein classorg.apache.lucene.index.KnnVectorValues
-
ordToDoc
public int ordToDoc(int ord) - Overrides:
ordToDocin classorg.apache.lucene.index.KnnVectorValues
-