Class ElasticsearchByteVectorFieldCodec
java.lang.Object
org.hibernate.search.backend.elasticsearch.types.codec.impl.AbstractElasticsearchFieldCodec<F>
org.hibernate.search.backend.elasticsearch.types.codec.impl.AbstractElasticsearchVectorFieldCodec<byte[]>
org.hibernate.search.backend.elasticsearch.types.codec.impl.ElasticsearchByteVectorFieldCodec
- All Implemented Interfaces:
ElasticsearchFieldCodec<byte[]>,ElasticsearchVectorFieldCodec<byte[]>
public class ElasticsearchByteVectorFieldCodec
extends AbstractElasticsearchVectorFieldCodec<byte[]>
-
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
ConstructorsConstructorDescriptionElasticsearchByteVectorFieldCodec(com.google.gson.Gson gson, VectorSimilarity similarity, int dimension, Integer m, Integer efConstruction, byte[] indexNullAs) -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]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(byte[] 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
-
ElasticsearchByteVectorFieldCodec
public ElasticsearchByteVectorFieldCodec(com.google.gson.Gson gson, VectorSimilarity similarity, int dimension, Integer m, Integer efConstruction, byte[] indexNullAs)
-
-
Method Details
-
toJsonArray
protected com.google.gson.JsonArray toJsonArray(byte[] value) - Specified by:
toJsonArrayin classAbstractElasticsearchVectorFieldCodec<byte[]>
-
fromJsonArray
protected byte[] fromJsonArray(com.google.gson.JsonArray jsonElements) - Specified by:
fromJsonArrayin classAbstractElasticsearchVectorFieldCodec<byte[]>
-
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.
-