Class ElasticsearchFloatVectorFieldCodec

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

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

      protected float[] fromJsonArray(com.google.gson.JsonArray jsonElements)
      Specified by:
      fromJsonArray in class AbstractElasticsearchVectorFieldCodec<float[]>
    • 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.