Class DenseVectorProperty.Builder

All Implemented Interfaces:
WithJson<DenseVectorProperty.Builder>, ObjectBuilder<DenseVectorProperty>
Enclosing class:
DenseVectorProperty

public static class DenseVectorProperty.Builder extends PropertyBase.AbstractBuilder<DenseVectorProperty.Builder> implements ObjectBuilder<DenseVectorProperty>
Builder for DenseVectorProperty.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • dims

      public final DenseVectorProperty.Builder dims(@Nullable Integer value)
      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

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

      API name: element_type

    • index

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

      API name: index

    • indexOptions

      public final DenseVectorProperty.Builder indexOptions(@Nullable DenseVectorIndexOptions value)
      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

    • 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

      public final DenseVectorProperty.Builder similarity(@Nullable DenseVectorSimilarity value)
      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

    • self

      protected DenseVectorProperty.Builder self()
      Specified by:
      self in class PropertyBase.AbstractBuilder<DenseVectorProperty.Builder>
    • build

      public DenseVectorProperty build()
      Specified by:
      build in interface ObjectBuilder<DenseVectorProperty>
      Throws:
      NullPointerException - if some of the required fields are null.