Class ElasticsearchFloatVectorFieldCodec
java.lang.Object
org.hibernate.search.backend.elasticsearch.types.codec.impl.AbstractElasticsearchFieldCodec<F>
org.hibernate.search.backend.elasticsearch.types.codec.impl.AbstractElasticsearchVectorFieldCodec<float[]>
org.hibernate.search.backend.elasticsearch.types.codec.impl.ElasticsearchFloatVectorFieldCodec
- All Implemented Interfaces:
ElasticsearchFieldCodec<float[]>,ElasticsearchVectorFieldCodec<float[]>
public class ElasticsearchFloatVectorFieldCodec
extends AbstractElasticsearchVectorFieldCodec<float[]>
-
Field Summary
Fields inherited from class org.hibernate.search.backend.elasticsearch.types.codec.impl.AbstractElasticsearchVectorFieldCodec
dimension, similarityFields inherited from class org.hibernate.search.backend.elasticsearch.types.codec.impl.AbstractElasticsearchFieldCodec
gson -
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchFloatVectorFieldCodec(com.google.gson.Gson gson, VectorSimilarity similarity, int dimension, Integer m, Integer efConstruction, float[] indexNullAs) -
Method Summary
Modifier and TypeMethodDescriptionprotected float[]fromJsonArray(com.google.gson.JsonArray jsonElements) floatscoreToSimilarity(float score) Convert the score vale to the similarity to be passed to the knn filter.protected com.google.gson.JsonArraytoJsonArray(float[] value) Class<?>Methods inherited from class org.hibernate.search.backend.elasticsearch.types.codec.impl.AbstractElasticsearchVectorFieldCodec
canDecodeArrays, decode, encode, getConfiguredDimensions, isCompatibleWith, toStringMethods 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, fromJsonStringToElement
-
Constructor Details
-
ElasticsearchFloatVectorFieldCodec
public ElasticsearchFloatVectorFieldCodec(com.google.gson.Gson gson, VectorSimilarity similarity, int dimension, Integer m, Integer efConstruction, float[] indexNullAs)
-
-
Method Details
-
toJsonArray
protected com.google.gson.JsonArray toJsonArray(float[] value) - Specified by:
toJsonArrayin classAbstractElasticsearchVectorFieldCodec<float[]>
-
fromJsonArray
protected float[] fromJsonArray(com.google.gson.JsonArray jsonElements) - Specified by:
fromJsonArrayin classAbstractElasticsearchVectorFieldCodec<float[]>
-
vectorElementsType
- Returns:
- The type of vector elements expected to get either
float.classorbyte.class.
-
scoreToSimilarity
public float scoreToSimilarity(float score) Description copied from interface:ElasticsearchVectorFieldCodecConvert the score vale to the similarity to be passed to the knn filter.
-