Class ElasticsearchByteVectorFieldCodec

All Implemented Interfaces:
ElasticsearchFieldCodec<byte[]>, ElasticsearchVectorFieldCodec<byte[]>

public class ElasticsearchByteVectorFieldCodec extends AbstractElasticsearchVectorFieldCodec<byte[]>
  • 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:
      toJsonArray in class AbstractElasticsearchVectorFieldCodec<byte[]>
    • fromJsonArray

      protected byte[] fromJsonArray(com.google.gson.JsonArray jsonElements)
      Specified by:
      fromJsonArray in class AbstractElasticsearchVectorFieldCodec<byte[]>
    • vectorElementsType

      public Class<?> vectorElementsType()
      Returns:
      The type of vector elements expected to get either float.class or byte.class.
    • scoreToSimilarity

      public float scoreToSimilarity(float score)
      Description copied from interface: ElasticsearchVectorFieldCodec
      Convert the score vale to the similarity to be passed to the knn filter.