From a10694253e4da244bfa54623db6adae308895895 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Thu, 28 May 2026 09:33:15 +0000 Subject: [PATCH] [codegen] update to latest spec --- .../mapping/DenseVectorIndexOptions.java | 50 +++++++++++++++++++ .../elasticsearch/doc-files/api-spec.html | 10 ++-- 2 files changed, 55 insertions(+), 5 deletions(-) diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DenseVectorIndexOptions.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DenseVectorIndexOptions.java index 535a22d4ee..3435ead818 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DenseVectorIndexOptions.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DenseVectorIndexOptions.java @@ -79,6 +79,9 @@ public class DenseVectorIndexOptions implements JsonpSerializable { @Nullable private final Boolean onDiskRescore; + @Nullable + private final Integer flatIndexThreshold; + // --------------------------------------------------------------------------------------------- private DenseVectorIndexOptions(Builder builder) { @@ -89,6 +92,7 @@ private DenseVectorIndexOptions(Builder builder) { this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); this.rescoreVector = builder.rescoreVector; this.onDiskRescore = builder.onDiskRescore; + this.flatIndexThreshold = builder.flatIndexThreshold; } @@ -183,6 +187,24 @@ public final Boolean onDiskRescore() { return this.onDiskRescore; } + /** + * 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: {@code flat_index_threshold} + */ + @Nullable + public final Integer flatIndexThreshold() { + return this.flatIndexThreshold; + } + /** * Serialize this object to JSON. */ @@ -221,6 +243,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.onDiskRescore); } + if (this.flatIndexThreshold != null) { + generator.writeKey("flat_index_threshold"); + generator.write(this.flatIndexThreshold); + + } } @@ -255,6 +282,9 @@ public static class Builder extends WithJsonObjectBuilderBase @Nullable private Boolean onDiskRescore; + @Nullable + private Integer flatIndexThreshold; + public Builder() { } private Builder(DenseVectorIndexOptions instance) { @@ -264,6 +294,7 @@ private Builder(DenseVectorIndexOptions instance) { this.type = instance.type; this.rescoreVector = instance.rescoreVector; this.onDiskRescore = instance.onDiskRescore; + this.flatIndexThreshold = instance.flatIndexThreshold; } /** @@ -367,6 +398,24 @@ public final Builder onDiskRescore(@Nullable Boolean value) { return this; } + /** + * 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: {@code flat_index_threshold} + */ + public final Builder flatIndexThreshold(@Nullable Integer value) { + this.flatIndexThreshold = value; + return this; + } + @Override protected Builder self() { return this; @@ -408,6 +457,7 @@ protected static void setupDenseVectorIndexOptionsDeserializer( op.add(Builder::type, DenseVectorIndexOptionsType._DESERIALIZER, "type"); op.add(Builder::rescoreVector, DenseVectorIndexOptionsRescoreVector._DESERIALIZER, "rescore_vector"); op.add(Builder::onDiskRescore, JsonpDeserializer.booleanDeserializer(), "on_disk_rescore"); + op.add(Builder::flatIndexThreshold, JsonpDeserializer.integerDeserializer(), "flat_index_threshold"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html index 5a4ee5d011..43a1441f4e 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html @@ -883,9 +883,9 @@ '_types.mapping.DateProperty': '_types/mapping/core.ts#L78-L90', '_types.mapping.DateRangeProperty': '_types/mapping/range.ts#L29-L32', '_types.mapping.DenseVectorElementType': '_types/mapping/DenseVectorProperty.ts#L64-L85', -'_types.mapping.DenseVectorIndexOptions': '_types/mapping/DenseVectorProperty.ts#L134-L179', -'_types.mapping.DenseVectorIndexOptionsRescoreVector': '_types/mapping/DenseVectorProperty.ts#L237-L245', -'_types.mapping.DenseVectorIndexOptionsType': '_types/mapping/DenseVectorProperty.ts#L181-L235', +'_types.mapping.DenseVectorIndexOptions': '_types/mapping/DenseVectorProperty.ts#L134-L189', +'_types.mapping.DenseVectorIndexOptionsRescoreVector': '_types/mapping/DenseVectorProperty.ts#L247-L255', +'_types.mapping.DenseVectorIndexOptionsType': '_types/mapping/DenseVectorProperty.ts#L191-L245', '_types.mapping.DenseVectorProperty': '_types/mapping/DenseVectorProperty.ts#L23-L62', '_types.mapping.DenseVectorSimilarity': '_types/mapping/DenseVectorProperty.ts#L87-L132', '_types.mapping.DocValuesPropertyBase': '_types/mapping/core.ts#L53-L55', @@ -3562,10 +3562,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/a11ffef0fa62bc289d624a0dde052163740ee4bf/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/ea5cd764eeab3a374bc18999c0ea39e554e62d2d/specification/" + (paths[hash] || ""); - Please see the Elasticsearch API specification. + Please see the Elasticsearch API specification.