Skip to content

Commit ef157c3

Browse files
committed
[codegen] update to latest spec
1 parent 6228acf commit ef157c3

File tree

146 files changed

+5744
-4582
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+5744
-4582
lines changed

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

+49-107
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import jakarta.json.stream.JsonGenerator;
3333
import java.lang.Float;
3434
import java.lang.Integer;
35+
import java.lang.String;
3536
import java.util.Objects;
3637
import java.util.function.Function;
3738
import javax.annotation.Nullable;
@@ -61,25 +62,25 @@
6162
*/
6263
@JsonpDeserializable
6364
public class DenseVectorIndexOptions implements JsonpSerializable {
65+
private final String type;
66+
6467
@Nullable
65-
private final Float confidenceInterval;
68+
private final Integer m;
6669

6770
@Nullable
6871
private final Integer efConstruction;
6972

7073
@Nullable
71-
private final Integer m;
72-
73-
private final DenseVectorIndexOptionsType type;
74+
private final Float confidenceInterval;
7475

7576
// ---------------------------------------------------------------------------------------------
7677

7778
private DenseVectorIndexOptions(Builder builder) {
7879

79-
this.confidenceInterval = builder.confidenceInterval;
80-
this.efConstruction = builder.efConstruction;
81-
this.m = builder.m;
8280
this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type");
81+
this.m = builder.m;
82+
this.efConstruction = builder.efConstruction;
83+
this.confidenceInterval = builder.confidenceInterval;
8384

8485
}
8586

@@ -88,64 +89,34 @@ public static DenseVectorIndexOptions of(Function<Builder, ObjectBuilder<DenseVe
8889
}
8990

9091
/**
91-
* The confidence interval to use when quantizing the vectors. Can be any value
92-
* between and including <code>0.90</code> and <code>1.0</code> or exactly
93-
* <code>0</code>. When the value is <code>0</code>, this indicates that dynamic
94-
* quantiles should be calculated for optimized quantization. When between
95-
* <code>0.90</code> and <code>1.0</code>, this value restricts the values used
96-
* when calculating the quantization thresholds.
97-
* <p>
98-
* For example, a value of <code>0.95</code> will only use the middle
99-
* <code>95%</code> of the values when calculating the quantization thresholds
100-
* (e.g. the highest and lowest <code>2.5%</code> of values will be ignored).
101-
* <p>
102-
* Defaults to <code>1/(dims + 1)</code> for <code>int8</code> quantized vectors
103-
* and <code>0</code> for <code>int4</code> for dynamic quantile calculation.
104-
* <p>
105-
* Only applicable to <code>int8_hnsw</code>, <code>int4_hnsw</code>,
106-
* <code>int8_flat</code>, and <code>int4_flat</code> index types.
107-
* <p>
108-
* API name: {@code confidence_interval}
92+
* Required - API name: {@code type}
10993
*/
110-
@Nullable
111-
public final Float confidenceInterval() {
112-
return this.confidenceInterval;
94+
public final String type() {
95+
return this.type;
11396
}
11497

11598
/**
116-
* The number of candidates to track while assembling the list of nearest
117-
* neighbors for each new node.
118-
* <p>
119-
* Only applicable to <code>hnsw</code>, <code>int8_hnsw</code>, and
120-
* <code>int4_hnsw</code> index types.
121-
* <p>
122-
* API name: {@code ef_construction}
99+
* API name: {@code m}
123100
*/
124101
@Nullable
125-
public final Integer efConstruction() {
126-
return this.efConstruction;
102+
public final Integer m() {
103+
return this.m;
127104
}
128105

129106
/**
130-
* The number of neighbors each node will be connected to in the HNSW graph.
131-
* <p>
132-
* Only applicable to <code>hnsw</code>, <code>int8_hnsw</code>, and
133-
* <code>int4_hnsw</code> index types.
134-
* <p>
135-
* API name: {@code m}
107+
* API name: {@code ef_construction}
136108
*/
137109
@Nullable
138-
public final Integer m() {
139-
return this.m;
110+
public final Integer efConstruction() {
111+
return this.efConstruction;
140112
}
141113

142114
/**
143-
* Required - The type of kNN algorithm to use.
144-
* <p>
145-
* API name: {@code type}
115+
* API name: {@code confidence_interval}
146116
*/
147-
public final DenseVectorIndexOptionsType type() {
148-
return this.type;
117+
@Nullable
118+
public final Float confidenceInterval() {
119+
return this.confidenceInterval;
149120
}
150121

151122
/**
@@ -159,23 +130,24 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
159130

160131
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
161132

162-
if (this.confidenceInterval != null) {
163-
generator.writeKey("confidence_interval");
164-
generator.write(this.confidenceInterval);
133+
generator.writeKey("type");
134+
generator.write(this.type);
135+
136+
if (this.m != null) {
137+
generator.writeKey("m");
138+
generator.write(this.m);
165139

166140
}
167141
if (this.efConstruction != null) {
168142
generator.writeKey("ef_construction");
169143
generator.write(this.efConstruction);
170144

171145
}
172-
if (this.m != null) {
173-
generator.writeKey("m");
174-
generator.write(this.m);
146+
if (this.confidenceInterval != null) {
147+
generator.writeKey("confidence_interval");
148+
generator.write(this.confidenceInterval);
175149

176150
}
177-
generator.writeKey("type");
178-
this.type.serialize(generator, mapper);
179151

180152
}
181153

@@ -193,76 +165,46 @@ public String toString() {
193165
public static class Builder extends WithJsonObjectBuilderBase<Builder>
194166
implements
195167
ObjectBuilder<DenseVectorIndexOptions> {
168+
private String type;
169+
196170
@Nullable
197-
private Float confidenceInterval;
171+
private Integer m;
198172

199173
@Nullable
200174
private Integer efConstruction;
201175

202176
@Nullable
203-
private Integer m;
204-
205-
private DenseVectorIndexOptionsType type;
177+
private Float confidenceInterval;
206178

207179
/**
208-
* The confidence interval to use when quantizing the vectors. Can be any value
209-
* between and including <code>0.90</code> and <code>1.0</code> or exactly
210-
* <code>0</code>. When the value is <code>0</code>, this indicates that dynamic
211-
* quantiles should be calculated for optimized quantization. When between
212-
* <code>0.90</code> and <code>1.0</code>, this value restricts the values used
213-
* when calculating the quantization thresholds.
214-
* <p>
215-
* For example, a value of <code>0.95</code> will only use the middle
216-
* <code>95%</code> of the values when calculating the quantization thresholds
217-
* (e.g. the highest and lowest <code>2.5%</code> of values will be ignored).
218-
* <p>
219-
* Defaults to <code>1/(dims + 1)</code> for <code>int8</code> quantized vectors
220-
* and <code>0</code> for <code>int4</code> for dynamic quantile calculation.
221-
* <p>
222-
* Only applicable to <code>int8_hnsw</code>, <code>int4_hnsw</code>,
223-
* <code>int8_flat</code>, and <code>int4_flat</code> index types.
224-
* <p>
225-
* API name: {@code confidence_interval}
180+
* Required - API name: {@code type}
226181
*/
227-
public final Builder confidenceInterval(@Nullable Float value) {
228-
this.confidenceInterval = value;
182+
public final Builder type(String value) {
183+
this.type = value;
229184
return this;
230185
}
231186

232187
/**
233-
* The number of candidates to track while assembling the list of nearest
234-
* neighbors for each new node.
235-
* <p>
236-
* Only applicable to <code>hnsw</code>, <code>int8_hnsw</code>, and
237-
* <code>int4_hnsw</code> index types.
238-
* <p>
239-
* API name: {@code ef_construction}
188+
* API name: {@code m}
240189
*/
241-
public final Builder efConstruction(@Nullable Integer value) {
242-
this.efConstruction = value;
190+
public final Builder m(@Nullable Integer value) {
191+
this.m = value;
243192
return this;
244193
}
245194

246195
/**
247-
* The number of neighbors each node will be connected to in the HNSW graph.
248-
* <p>
249-
* Only applicable to <code>hnsw</code>, <code>int8_hnsw</code>, and
250-
* <code>int4_hnsw</code> index types.
251-
* <p>
252-
* API name: {@code m}
196+
* API name: {@code ef_construction}
253197
*/
254-
public final Builder m(@Nullable Integer value) {
255-
this.m = value;
198+
public final Builder efConstruction(@Nullable Integer value) {
199+
this.efConstruction = value;
256200
return this;
257201
}
258202

259203
/**
260-
* Required - The type of kNN algorithm to use.
261-
* <p>
262-
* API name: {@code type}
204+
* API name: {@code confidence_interval}
263205
*/
264-
public final Builder type(DenseVectorIndexOptionsType value) {
265-
this.type = value;
206+
public final Builder confidenceInterval(@Nullable Float value) {
207+
this.confidenceInterval = value;
266208
return this;
267209
}
268210

@@ -295,10 +237,10 @@ public DenseVectorIndexOptions build() {
295237
protected static void setupDenseVectorIndexOptionsDeserializer(
296238
ObjectDeserializer<DenseVectorIndexOptions.Builder> op) {
297239

298-
op.add(Builder::confidenceInterval, JsonpDeserializer.floatDeserializer(), "confidence_interval");
299-
op.add(Builder::efConstruction, JsonpDeserializer.integerDeserializer(), "ef_construction");
240+
op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type");
300241
op.add(Builder::m, JsonpDeserializer.integerDeserializer(), "m");
301-
op.add(Builder::type, DenseVectorIndexOptionsType._DESERIALIZER, "type");
242+
op.add(Builder::efConstruction, JsonpDeserializer.integerDeserializer(), "ef_construction");
243+
op.add(Builder::confidenceInterval, JsonpDeserializer.floatDeserializer(), "confidence_interval");
302244

303245
}
304246

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

-107
This file was deleted.

0 commit comments

Comments
 (0)