Class VectorColumn<T>
java.lang.Object
org.apache.lucene.document.column.Column
org.apache.lucene.document.column.VectorColumn<T>
- Type Parameters:
T- the vector array type, eitherfloat[]orbyte[]
A
Column that provides KNN vector values via a tuple cursor. Vector columns are
vector-only: the field type must declare vectorDimension() > 0, and must not also set doc
values, points, stored, or indexOptions. Vectors are single-valued, so the cursor yields
strictly increasing batch-local doc-ids.
The type parameter T must match IndexableFieldType.vectorEncoding():
float[] for FLOAT32 and byte[] for BYTE. A mismatch is reported as a ClassCastException when values are
consumed during indexing.
DENSE indicates that every batch-local doc has a vector; SPARSE allows gaps. Both densities use the same tuple cursor — there is no
dense bulk-fill fast path for vectors.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.document.column.Column
Column.Density -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVectorColumn(String name, IndexableFieldType fieldType, Column.Density density) Creates a VectorColumn with the given field name, type, and density. -
Method Summary
Modifier and TypeMethodDescriptionabstract ObjectTupleCursor<T> tuples()Returns a fresh tuple cursor starting at the beginning of the batch.
-
Constructor Details
-
VectorColumn
Creates a VectorColumn with the given field name, type, and density.- Throws:
IllegalArgumentException- iffieldType.vectorDimension() <= 0
-
-
Method Details
-
tuples
Returns a fresh tuple cursor starting at the beginning of the batch.
-