Module org.elasticsearch.server
Class ByteKnnDenseVectorDocValuesField
java.lang.Object
org.elasticsearch.script.field.AbstractScriptFieldFactory<DenseVector>
org.elasticsearch.script.field.vectors.DenseVectorDocValuesField
org.elasticsearch.script.field.vectors.ByteKnnDenseVectorDocValuesField
- All Implemented Interfaces:
Iterable<DenseVector>,ScriptDocValues.Supplier<org.apache.lucene.util.BytesRef>,DenseVectorScriptDocValues.DenseVectorSupplier,DocValuesScriptFieldFactory,Field<DenseVector>,ScriptFieldFactory
- Direct Known Subclasses:
BitKnnDenseVectorDocValuesField
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected org.apache.lucene.index.ByteVectorValuesprotected byte[]Fields inherited from class org.elasticsearch.script.field.vectors.DenseVectorDocValuesField
elementType, name -
Constructor Summary
ConstructorsModifierConstructorDescriptionByteKnnDenseVectorDocValuesField(org.apache.lucene.index.ByteVectorValues input, String name, int dims) protectedByteKnnDenseVectorDocValuesField(org.apache.lucene.index.ByteVectorValues input, String name, int dims, DenseVectorFieldMapper.ElementType elementType) -
Method Summary
Modifier and TypeMethodDescriptionget()Get the DenseVector for a document if one exists, DenseVector.EMPTY otherwiseget(DenseVector defaultValue) protected DenseVectorbooleanisEmpty()Returnstrueif this field has no values, otherwisefalse.voidsetNextDocId(int docId) Set the current document ID.Returns aScriptDocValuesof the appropriate type for this field.Methods inherited from class org.elasticsearch.script.field.vectors.DenseVectorDocValuesField
getElementType, getName, iterator, sizeMethods inherited from class org.elasticsearch.script.field.AbstractScriptFieldFactory
toScriptFieldMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.index.mapper.vectors.DenseVectorScriptDocValues.DenseVectorSupplier
getInternalMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.elasticsearch.script.field.ScriptFieldFactory
toScriptField
-
Field Details
-
input
protected org.apache.lucene.index.ByteVectorValues input -
vector
protected byte[] vector -
dims
protected final int dims
-
-
Constructor Details
-
ByteKnnDenseVectorDocValuesField
-
ByteKnnDenseVectorDocValuesField
protected ByteKnnDenseVectorDocValuesField(@Nullable org.apache.lucene.index.ByteVectorValues input, String name, int dims, DenseVectorFieldMapper.ElementType elementType)
-
-
Method Details
-
setNextDocId
Description copied from interface:DocValuesScriptFieldFactorySet the current document ID.- Throws:
IOException
-
toScriptDocValues
Description copied from interface:DocValuesScriptFieldFactoryReturns aScriptDocValuesof the appropriate type for this field. This is used to support backwards compatibility for accessing field values through thedocvariable.- Specified by:
toScriptDocValuesin interfaceDocValuesScriptFieldFactory- Specified by:
toScriptDocValuesin classDenseVectorDocValuesField
-
isEmpty
public boolean isEmpty()Description copied from interface:FieldReturnstrueif this field has no values, otherwisefalse. -
getVector
-
get
Description copied from class:DenseVectorDocValuesFieldGet the DenseVector for a document if one exists, DenseVector.EMPTY otherwise- Specified by:
getin classDenseVectorDocValuesField
-
get
- Specified by:
getin classDenseVectorDocValuesField
-
getInternal
-