Class DenseVectorIndexOptions.Builder

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

public static class DenseVectorIndexOptions.Builder extends WithJsonObjectBuilderBase<DenseVectorIndexOptions.Builder> implements ObjectBuilder<DenseVectorIndexOptions>
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • confidenceInterval

      public final DenseVectorIndexOptions.Builder confidenceInterval(@Nullable Float value)
      The confidence interval to use when quantizing the vectors. Can be any value between and including 0.90 and 1.0 or exactly 0. When the value is 0, this indicates that dynamic quantiles should be calculated for optimized quantization. When between 0.90 and 1.0, this value restricts the values used when calculating the quantization thresholds.

      For example, a value of 0.95 will only use the middle 95% of the values when calculating the quantization thresholds (e.g. the highest and lowest 2.5% of values will be ignored).

      Defaults to 1/(dims + 1) for int8 quantized vectors and 0 for int4 for dynamic quantile calculation.

      Only applicable to int8_hnsw, int4_hnsw, int8_flat, and int4_flat index types.

      API name: confidence_interval

    • efConstruction

      public final DenseVectorIndexOptions.Builder efConstruction(@Nullable Integer value)
      The number of candidates to track while assembling the list of nearest neighbors for each new node.

      Only applicable to hnsw, int8_hnsw, bbq_hnsw, and int4_hnsw index types.

      API name: ef_construction

    • m

      public final DenseVectorIndexOptions.Builder m(@Nullable Integer value)
      The number of neighbors each node will be connected to in the HNSW graph.

      Only applicable to hnsw, int8_hnsw, bbq_hnsw, and int4_hnsw index types.

      API name: m

    • type

      Required - The type of kNN algorithm to use.

      API name: type

    • rescoreVector

      public final DenseVectorIndexOptions.Builder rescoreVector(@Nullable DenseVectorIndexOptionsRescoreVector value)
      The rescore vector options. This is only applicable to bbq_disk, bbq_hnsw, int4_hnsw, int8_hnsw, bbq_flat, int4_flat, and int8_flat index types.

      API name: rescore_vector

    • rescoreVector

      The rescore vector options. This is only applicable to bbq_disk, bbq_hnsw, int4_hnsw, int8_hnsw, bbq_flat, int4_flat, and int8_flat index types.

      API name: rescore_vector

    • onDiskRescore

      public final DenseVectorIndexOptions.Builder onDiskRescore(@Nullable Boolean value)
      true if vector rescoring should be done on-disk

      Only applicable to bbq_disk, bbq_hnsw, int4_hnsw, int8_hnsw

      API name: on_disk_rescore

    • flatIndexThreshold

      public final DenseVectorIndexOptions.Builder flatIndexThreshold(@Nullable Integer value)
      The segment document count threshold below which HNSW graph construction is skipped in favor of brute-force flat search. -1 (default) defers to format defaults: 300 for bbq_hnsw, 150 for hnsw, int8_hnsw, and int4_hnsw. 0 always builds the graph. A positive value overrides the format default.

      Only applicable to hnsw, int8_hnsw, int4_hnsw, and bbq_hnsw index types.

      API name: flat_index_threshold

    • self

      Specified by:
      self in class WithJsonObjectBuilderBase<DenseVectorIndexOptions.Builder>
    • build

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