Skip to content

Commit a3a20a7

Browse files
[codegen] update to latest spec (#1240)
Co-authored-by: Laura Trotta <laura.trotta@elastic.co> Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
1 parent 91e716c commit a3a20a7

2 files changed

Lines changed: 55 additions & 5 deletions

File tree

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DenseVectorIndexOptions.java

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ public class DenseVectorIndexOptions implements JsonpSerializable {
7979
@Nullable
8080
private final Boolean onDiskRescore;
8181

82+
@Nullable
83+
private final Integer flatIndexThreshold;
84+
8285
// ---------------------------------------------------------------------------------------------
8386

8487
private DenseVectorIndexOptions(Builder builder) {
@@ -89,6 +92,7 @@ private DenseVectorIndexOptions(Builder builder) {
8992
this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type");
9093
this.rescoreVector = builder.rescoreVector;
9194
this.onDiskRescore = builder.onDiskRescore;
95+
this.flatIndexThreshold = builder.flatIndexThreshold;
9296

9397
}
9498

@@ -183,6 +187,24 @@ public final Boolean onDiskRescore() {
183187
return this.onDiskRescore;
184188
}
185189

190+
/**
191+
* The segment document count threshold below which HNSW graph construction is
192+
* skipped in favor of brute-force flat search. <code>-1</code> (default) defers
193+
* to format defaults: <code>300</code> for <code>bbq_hnsw</code>,
194+
* <code>150</code> for <code>hnsw</code>, <code>int8_hnsw</code>, and
195+
* <code>int4_hnsw</code>. <code>0</code> always builds the graph. A positive
196+
* value overrides the format default.
197+
* <p>
198+
* Only applicable to <code>hnsw</code>, <code>int8_hnsw</code>,
199+
* <code>int4_hnsw</code>, and <code>bbq_hnsw</code> index types.
200+
* <p>
201+
* API name: {@code flat_index_threshold}
202+
*/
203+
@Nullable
204+
public final Integer flatIndexThreshold() {
205+
return this.flatIndexThreshold;
206+
}
207+
186208
/**
187209
* Serialize this object to JSON.
188210
*/
@@ -221,6 +243,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
221243
generator.write(this.onDiskRescore);
222244

223245
}
246+
if (this.flatIndexThreshold != null) {
247+
generator.writeKey("flat_index_threshold");
248+
generator.write(this.flatIndexThreshold);
249+
250+
}
224251

225252
}
226253

@@ -255,6 +282,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
255282
@Nullable
256283
private Boolean onDiskRescore;
257284

285+
@Nullable
286+
private Integer flatIndexThreshold;
287+
258288
public Builder() {
259289
}
260290
private Builder(DenseVectorIndexOptions instance) {
@@ -264,6 +294,7 @@ private Builder(DenseVectorIndexOptions instance) {
264294
this.type = instance.type;
265295
this.rescoreVector = instance.rescoreVector;
266296
this.onDiskRescore = instance.onDiskRescore;
297+
this.flatIndexThreshold = instance.flatIndexThreshold;
267298

268299
}
269300
/**
@@ -367,6 +398,24 @@ public final Builder onDiskRescore(@Nullable Boolean value) {
367398
return this;
368399
}
369400

401+
/**
402+
* The segment document count threshold below which HNSW graph construction is
403+
* skipped in favor of brute-force flat search. <code>-1</code> (default) defers
404+
* to format defaults: <code>300</code> for <code>bbq_hnsw</code>,
405+
* <code>150</code> for <code>hnsw</code>, <code>int8_hnsw</code>, and
406+
* <code>int4_hnsw</code>. <code>0</code> always builds the graph. A positive
407+
* value overrides the format default.
408+
* <p>
409+
* Only applicable to <code>hnsw</code>, <code>int8_hnsw</code>,
410+
* <code>int4_hnsw</code>, and <code>bbq_hnsw</code> index types.
411+
* <p>
412+
* API name: {@code flat_index_threshold}
413+
*/
414+
public final Builder flatIndexThreshold(@Nullable Integer value) {
415+
this.flatIndexThreshold = value;
416+
return this;
417+
}
418+
370419
@Override
371420
protected Builder self() {
372421
return this;
@@ -408,6 +457,7 @@ protected static void setupDenseVectorIndexOptionsDeserializer(
408457
op.add(Builder::type, DenseVectorIndexOptionsType._DESERIALIZER, "type");
409458
op.add(Builder::rescoreVector, DenseVectorIndexOptionsRescoreVector._DESERIALIZER, "rescore_vector");
410459
op.add(Builder::onDiskRescore, JsonpDeserializer.booleanDeserializer(), "on_disk_rescore");
460+
op.add(Builder::flatIndexThreshold, JsonpDeserializer.integerDeserializer(), "flat_index_threshold");
411461

412462
}
413463

java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -883,9 +883,9 @@
883883
'_types.mapping.DateProperty': '_types/mapping/core.ts#L78-L90',
884884
'_types.mapping.DateRangeProperty': '_types/mapping/range.ts#L29-L32',
885885
'_types.mapping.DenseVectorElementType': '_types/mapping/DenseVectorProperty.ts#L64-L85',
886-
'_types.mapping.DenseVectorIndexOptions': '_types/mapping/DenseVectorProperty.ts#L134-L179',
887-
'_types.mapping.DenseVectorIndexOptionsRescoreVector': '_types/mapping/DenseVectorProperty.ts#L237-L245',
888-
'_types.mapping.DenseVectorIndexOptionsType': '_types/mapping/DenseVectorProperty.ts#L181-L235',
886+
'_types.mapping.DenseVectorIndexOptions': '_types/mapping/DenseVectorProperty.ts#L134-L189',
887+
'_types.mapping.DenseVectorIndexOptionsRescoreVector': '_types/mapping/DenseVectorProperty.ts#L247-L255',
888+
'_types.mapping.DenseVectorIndexOptionsType': '_types/mapping/DenseVectorProperty.ts#L191-L245',
889889
'_types.mapping.DenseVectorProperty': '_types/mapping/DenseVectorProperty.ts#L23-L62',
890890
'_types.mapping.DenseVectorSimilarity': '_types/mapping/DenseVectorProperty.ts#L87-L132',
891891
'_types.mapping.DocValuesPropertyBase': '_types/mapping/core.ts#L53-L55',
@@ -3562,10 +3562,10 @@
35623562
if (hash.length > 1) {
35633563
hash = hash.substring(1);
35643564
}
3565-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/a11ffef0fa62bc289d624a0dde052163740ee4bf/specification/" + (paths[hash] || "");
3565+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/ea5cd764eeab3a374bc18999c0ea39e554e62d2d/specification/" + (paths[hash] || "");
35663566
</script>
35673567
</head>
35683568
<body>
3569-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/a11ffef0fa62bc289d624a0dde052163740ee4bf/specification/">Elasticsearch API specification</a>.
3569+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/ea5cd764eeab3a374bc18999c0ea39e554e62d2d/specification/">Elasticsearch API specification</a>.
35703570
</body>
35713571
</html>

0 commit comments

Comments
 (0)