Class AbstractElasticsearchVectorFieldCodec<F>
java.lang.Object
org.hibernate.search.backend.elasticsearch.types.codec.impl.AbstractElasticsearchFieldCodec<F>
org.hibernate.search.backend.elasticsearch.types.codec.impl.AbstractElasticsearchVectorFieldCodec<F>
- All Implemented Interfaces:
ElasticsearchFieldCodec<F>,ElasticsearchVectorFieldCodec<F>
- Direct Known Subclasses:
ElasticsearchByteVectorFieldCodec,ElasticsearchFloatVectorFieldCodec
public abstract class AbstractElasticsearchVectorFieldCodec<F>
extends AbstractElasticsearchFieldCodec<F>
implements ElasticsearchVectorFieldCodec<F>
-
Field Summary
FieldsFields inherited from class org.hibernate.search.backend.elasticsearch.types.codec.impl.AbstractElasticsearchFieldCodec
gson -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractElasticsearchVectorFieldCodec(com.google.gson.Gson gson, VectorSimilarity similarity, int dimension, Integer m, Integer efConstruction, F indexNullAs) -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether this codec can extract data from JsonArrays when decoding.decode(com.google.gson.JsonElement element) com.google.gson.JsonElementprotected abstract FfromJsonArray(com.google.gson.JsonArray jsonElements) intbooleanisCompatibleWith(ElasticsearchFieldCodec<?> other) Determine whether another codec is compatible with this one, i.e. whether it will encode/decode the information to/from the document in a compatible way.protected abstract com.google.gson.JsonArraytoJsonArray(F value) toString()Methods inherited from class org.hibernate.search.backend.elasticsearch.types.codec.impl.AbstractElasticsearchFieldCodec
fromJsonElementToString, fromJsonStringToElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.search.backend.elasticsearch.types.codec.impl.ElasticsearchFieldCodec
decodeAggregationKey, encodeForAggregation, encodeForMissing, fromJsonElementToString, fromJsonStringToElementMethods inherited from interface org.hibernate.search.backend.elasticsearch.types.codec.impl.ElasticsearchVectorFieldCodec
scoreToSimilarity, vectorElementsType
-
Field Details
-
similarity
-
dimension
protected final int dimension
-
-
Constructor Details
-
AbstractElasticsearchVectorFieldCodec
protected AbstractElasticsearchVectorFieldCodec(com.google.gson.Gson gson, VectorSimilarity similarity, int dimension, Integer m, Integer efConstruction, F indexNullAs)
-
-
Method Details
-
encode
- Specified by:
encodein interfaceElasticsearchFieldCodec<F>
-
toJsonArray
-
decode
- Specified by:
decodein interfaceElasticsearchFieldCodec<F>
-
fromJsonArray
-
getConfiguredDimensions
public int getConfiguredDimensions()- Specified by:
getConfiguredDimensionsin interfaceElasticsearchVectorFieldCodec<F>- Returns:
- The number of dimensions (array length) of vectors to be indexed that this codec can process.
-
isCompatibleWith
Description copied from interface:ElasticsearchFieldCodecDetermine whether another codec is compatible with this one, i.e. whether it will encode/decode the information to/from the document in a compatible way.- Specified by:
isCompatibleWithin interfaceElasticsearchFieldCodec<F>- Parameters:
other- AnotherElasticsearchFieldCodec, nevernull.- Returns:
trueif the given codec is compatible.falseotherwise, or when in doubt.
-
canDecodeArrays
public boolean canDecodeArrays()Description copied from interface:ElasticsearchFieldCodecWhether this codec can extract data from JsonArrays when decoding.- Specified by:
canDecodeArraysin interfaceElasticsearchFieldCodec<F>
-
toString
-