Module org.elasticsearch.server
Class KnnDenseVectorDocValuesField
java.lang.Object
org.elasticsearch.script.field.AbstractScriptFieldFactory<DenseVector>
org.elasticsearch.script.field.vectors.DenseVectorDocValuesField
org.elasticsearch.script.field.vectors.KnnDenseVectorDocValuesField
- All Implemented Interfaces:
Iterable<DenseVector>,ScriptDocValues.Supplier<org.apache.lucene.util.BytesRef>,DenseVectorScriptDocValues.DenseVectorSupplier,DocValuesScriptFieldFactory,Field<DenseVector>,ScriptFieldFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected org.apache.lucene.index.FloatVectorValuesprotected float[]Fields inherited from class org.elasticsearch.script.field.vectors.DenseVectorDocValuesField
elementType, name -
Constructor Summary
ConstructorsConstructorDescriptionKnnDenseVectorDocValuesField(org.apache.lucene.index.FloatVectorValues input, String name, int dims) -
Method Summary
Modifier and TypeMethodDescriptionget()Get the DenseVector for a document if one exists, DenseVector.EMPTY otherwiseget(DenseVector defaultValue) booleanisEmpty()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.FloatVectorValues input -
vector
protected float[] vector -
dims
protected final int dims
-
-
Constructor Details
-
KnnDenseVectorDocValuesField
-
-
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. -
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
-