Class DenseVectorProperty

java.lang.Object
co.elastic.clients.elasticsearch._types.mapping.PropertyBase
co.elastic.clients.elasticsearch._types.mapping.DenseVectorProperty
All Implemented Interfaces:
PropertyVariant, JsonpSerializable

@JsonpDeserializable public class DenseVectorProperty extends PropertyBase implements PropertyVariant
See Also:
  • Field Details

  • Method Details

    • of

    • _propertyKind

      public Property.Kind _propertyKind()
      Property variant kind.
      Specified by:
      _propertyKind in interface PropertyVariant
    • dims

      @Nullable public final Integer dims()
      Number of vector dimensions. Can't exceed 4096. If dims is not specified, it will be set to the length of the first vector added to the field.

      API name: dims

    • elementType

      @Nullable public final DenseVectorElementType elementType()
      The data type used to encode vectors. The supported data types are float (default), byte, and bit.

      API name: element_type

    • index

      @Nullable public final Boolean index()
      If true, you can search this field using the kNN search API.

      API name: index

    • indexOptions

      @Nullable public final DenseVectorIndexOptions indexOptions()
      An optional section that configures the kNN indexing algorithm. The HNSW algorithm has two internal parameters that influence how the data structure is built. These can be adjusted to improve the accuracy of results, at the expense of slower indexing speed.

      This parameter can only be specified when index is true.

      API name: index_options

    • similarity

      @Nullable public final DenseVectorSimilarity similarity()
      The vector similarity metric to use in kNN search.

      Documents are ranked by their vector field's similarity to the query vector. The _score of each document will be derived from the similarity, in a way that ensures scores are positive and that a larger score corresponds to a higher ranking.

      Defaults to l2_norm when element_type is bit otherwise defaults to cosine.

      bit vectors only support l2_norm as their similarity metric.

      This parameter can only be specified when index is true.

      API name: similarity

    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Overrides:
      serializeInternal in class PropertyBase
    • setupDenseVectorPropertyDeserializer

      protected static void setupDenseVectorPropertyDeserializer(ObjectDeserializer<DenseVectorProperty.Builder> op)