Skip to content

Commit 5c3eb2a

Browse files
committed
[codegen] update to latest spec
1 parent 2fd09bb commit 5c3eb2a

19 files changed

+3013
-139
lines changed

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import co.elastic.clients.json.JsonpUtils;
2727
import co.elastic.clients.json.ObjectBuilderDeserializer;
2828
import co.elastic.clients.json.ObjectDeserializer;
29-
import co.elastic.clients.util.ApiTypeHelper;
3029
import co.elastic.clients.util.ObjectBuilder;
3130
import co.elastic.clients.util.WithJsonObjectBuilderBase;
3231
import jakarta.json.stream.JsonGenerator;
@@ -59,19 +58,21 @@
5958
*/
6059

6160
public abstract class ShardsOperationResponseBase implements JsonpSerializable {
61+
@Nullable
6262
private final ShardStatistics shards;
6363

6464
// ---------------------------------------------------------------------------------------------
6565

6666
protected ShardsOperationResponseBase(AbstractBuilder<?> builder) {
6767

68-
this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards");
68+
this.shards = builder.shards;
6969

7070
}
7171

7272
/**
73-
* Required - API name: {@code _shards}
73+
* API name: {@code _shards}
7474
*/
75+
@Nullable
7576
public final ShardStatistics shards() {
7677
return this.shards;
7778
}
@@ -87,8 +88,11 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
8788

8889
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
8990

90-
generator.writeKey("_shards");
91-
this.shards.serialize(generator, mapper);
91+
if (this.shards != null) {
92+
generator.writeKey("_shards");
93+
this.shards.serialize(generator, mapper);
94+
95+
}
9296

9397
}
9498

@@ -100,18 +104,19 @@ public String toString() {
100104
public abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<BuilderT>>
101105
extends
102106
WithJsonObjectBuilderBase<BuilderT> {
107+
@Nullable
103108
private ShardStatistics shards;
104109

105110
/**
106-
* Required - API name: {@code _shards}
111+
* API name: {@code _shards}
107112
*/
108-
public final BuilderT shards(ShardStatistics value) {
113+
public final BuilderT shards(@Nullable ShardStatistics value) {
109114
this.shards = value;
110115
return self();
111116
}
112117

113118
/**
114-
* Required - API name: {@code _shards}
119+
* API name: {@code _shards}
115120
*/
116121
public final BuilderT shards(Function<ShardStatistics.Builder, ObjectBuilder<ShardStatistics>> fn) {
117122
return this.shards(fn.apply(new ShardStatistics.Builder()).build());

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermsSetQuery.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public class TermsSetQuery extends QueryBase implements QueryVariant {
6262
// Single key dictionary
6363
private final String field;
6464

65+
@Nullable
66+
private final String minimumShouldMatch;
67+
6568
@Nullable
6669
private final String minimumShouldMatchField;
6770

@@ -76,6 +79,7 @@ private TermsSetQuery(Builder builder) {
7679
super(builder);
7780
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
7881

82+
this.minimumShouldMatch = builder.minimumShouldMatch;
7983
this.minimumShouldMatchField = builder.minimumShouldMatchField;
8084
this.minimumShouldMatchScript = builder.minimumShouldMatchScript;
8185
this.terms = ApiTypeHelper.unmodifiableRequired(builder.terms, this, "terms");
@@ -101,6 +105,17 @@ public final String field() {
101105
return this.field;
102106
}
103107

108+
/**
109+
* Specification describing number of matching terms required to return a
110+
* document.
111+
* <p>
112+
* API name: {@code minimum_should_match}
113+
*/
114+
@Nullable
115+
public final String minimumShouldMatch() {
116+
return this.minimumShouldMatch;
117+
}
118+
104119
/**
105120
* Numeric field containing the number of matching terms required to return a
106121
* document.
@@ -136,6 +151,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
136151
generator.writeStartObject(this.field);
137152

138153
super.serializeInternal(generator, mapper);
154+
if (this.minimumShouldMatch != null) {
155+
generator.writeKey("minimum_should_match");
156+
generator.write(this.minimumShouldMatch);
157+
158+
}
139159
if (this.minimumShouldMatchField != null) {
140160
generator.writeKey("minimum_should_match_field");
141161
generator.write(this.minimumShouldMatchField);
@@ -178,6 +198,9 @@ public final Builder field(String value) {
178198
return this;
179199
}
180200

201+
@Nullable
202+
private String minimumShouldMatch;
203+
181204
@Nullable
182205
private String minimumShouldMatchField;
183206

@@ -186,6 +209,17 @@ public final Builder field(String value) {
186209

187210
private List<String> terms;
188211

212+
/**
213+
* Specification describing number of matching terms required to return a
214+
* document.
215+
* <p>
216+
* API name: {@code minimum_should_match}
217+
*/
218+
public final Builder minimumShouldMatch(@Nullable String value) {
219+
this.minimumShouldMatch = value;
220+
return this;
221+
}
222+
189223
/**
190224
* Numeric field containing the number of matching terms required to return a
191225
* document.
@@ -270,6 +304,7 @@ public TermsSetQuery build() {
270304

271305
protected static void setupTermsSetQueryDeserializer(ObjectDeserializer<TermsSetQuery.Builder> op) {
272306
QueryBase.setupQueryBaseDeserializer(op);
307+
op.add(Builder::minimumShouldMatch, JsonpDeserializer.stringDeserializer(), "minimum_should_match");
273308
op.add(Builder::minimumShouldMatchField, JsonpDeserializer.stringDeserializer(), "minimum_should_match_field");
274309
op.add(Builder::minimumShouldMatchScript, Script._DESERIALIZER, "minimum_should_match_script");
275310
op.add(Builder::terms, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "terms");

java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/AggregationProfileDebug.java

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,18 @@ public class AggregationProfileDebug implements JsonpSerializable {
145145
@Nullable
146146
private final String mapReducer;
147147

148+
@Nullable
149+
private final Integer bruteForceUsed;
150+
151+
@Nullable
152+
private final Integer dynamicPruningAttempted;
153+
154+
@Nullable
155+
private final Integer dynamicPruningUsed;
156+
157+
@Nullable
158+
private final Integer skippedDueToNoData;
159+
148160
// ---------------------------------------------------------------------------------------------
149161

150162
private AggregationProfileDebug(Builder builder) {
@@ -177,6 +189,10 @@ private AggregationProfileDebug(Builder builder) {
177189
this.segmentsCounted = builder.segmentsCounted;
178190
this.segmentsCollected = builder.segmentsCollected;
179191
this.mapReducer = builder.mapReducer;
192+
this.bruteForceUsed = builder.bruteForceUsed;
193+
this.dynamicPruningAttempted = builder.dynamicPruningAttempted;
194+
this.dynamicPruningUsed = builder.dynamicPruningUsed;
195+
this.skippedDueToNoData = builder.skippedDueToNoData;
180196

181197
}
182198

@@ -406,6 +422,38 @@ public final String mapReducer() {
406422
return this.mapReducer;
407423
}
408424

425+
/**
426+
* API name: {@code brute_force_used}
427+
*/
428+
@Nullable
429+
public final Integer bruteForceUsed() {
430+
return this.bruteForceUsed;
431+
}
432+
433+
/**
434+
* API name: {@code dynamic_pruning_attempted}
435+
*/
436+
@Nullable
437+
public final Integer dynamicPruningAttempted() {
438+
return this.dynamicPruningAttempted;
439+
}
440+
441+
/**
442+
* API name: {@code dynamic_pruning_used}
443+
*/
444+
@Nullable
445+
public final Integer dynamicPruningUsed() {
446+
return this.dynamicPruningUsed;
447+
}
448+
449+
/**
450+
* API name: {@code skipped_due_to_no_data}
451+
*/
452+
@Nullable
453+
public final Integer skippedDueToNoData() {
454+
return this.skippedDueToNoData;
455+
}
456+
409457
/**
410458
* Serialize this object to JSON.
411459
*/
@@ -567,6 +615,26 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
567615
generator.write(this.mapReducer);
568616

569617
}
618+
if (this.bruteForceUsed != null) {
619+
generator.writeKey("brute_force_used");
620+
generator.write(this.bruteForceUsed);
621+
622+
}
623+
if (this.dynamicPruningAttempted != null) {
624+
generator.writeKey("dynamic_pruning_attempted");
625+
generator.write(this.dynamicPruningAttempted);
626+
627+
}
628+
if (this.dynamicPruningUsed != null) {
629+
generator.writeKey("dynamic_pruning_used");
630+
generator.write(this.dynamicPruningUsed);
631+
632+
}
633+
if (this.skippedDueToNoData != null) {
634+
generator.writeKey("skipped_due_to_no_data");
635+
generator.write(this.skippedDueToNoData);
636+
637+
}
570638

571639
}
572640

@@ -668,6 +736,18 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
668736
@Nullable
669737
private String mapReducer;
670738

739+
@Nullable
740+
private Integer bruteForceUsed;
741+
742+
@Nullable
743+
private Integer dynamicPruningAttempted;
744+
745+
@Nullable
746+
private Integer dynamicPruningUsed;
747+
748+
@Nullable
749+
private Integer skippedDueToNoData;
750+
671751
/**
672752
* API name: {@code segments_with_multi_valued_ords}
673753
*/
@@ -935,6 +1015,38 @@ public final Builder mapReducer(@Nullable String value) {
9351015
return this;
9361016
}
9371017

1018+
/**
1019+
* API name: {@code brute_force_used}
1020+
*/
1021+
public final Builder bruteForceUsed(@Nullable Integer value) {
1022+
this.bruteForceUsed = value;
1023+
return this;
1024+
}
1025+
1026+
/**
1027+
* API name: {@code dynamic_pruning_attempted}
1028+
*/
1029+
public final Builder dynamicPruningAttempted(@Nullable Integer value) {
1030+
this.dynamicPruningAttempted = value;
1031+
return this;
1032+
}
1033+
1034+
/**
1035+
* API name: {@code dynamic_pruning_used}
1036+
*/
1037+
public final Builder dynamicPruningUsed(@Nullable Integer value) {
1038+
this.dynamicPruningUsed = value;
1039+
return this;
1040+
}
1041+
1042+
/**
1043+
* API name: {@code skipped_due_to_no_data}
1044+
*/
1045+
public final Builder skippedDueToNoData(@Nullable Integer value) {
1046+
this.skippedDueToNoData = value;
1047+
return this;
1048+
}
1049+
9381050
@Override
9391051
protected Builder self() {
9401052
return this;
@@ -999,6 +1111,10 @@ protected static void setupAggregationProfileDebugDeserializer(
9991111
op.add(Builder::segmentsCounted, JsonpDeserializer.integerDeserializer(), "segments_counted");
10001112
op.add(Builder::segmentsCollected, JsonpDeserializer.integerDeserializer(), "segments_collected");
10011113
op.add(Builder::mapReducer, JsonpDeserializer.stringDeserializer(), "map_reducer");
1114+
op.add(Builder::bruteForceUsed, JsonpDeserializer.integerDeserializer(), "brute_force_used");
1115+
op.add(Builder::dynamicPruningAttempted, JsonpDeserializer.integerDeserializer(), "dynamic_pruning_attempted");
1116+
op.add(Builder::dynamicPruningUsed, JsonpDeserializer.integerDeserializer(), "dynamic_pruning_used");
1117+
op.add(Builder::skippedDueToNoData, JsonpDeserializer.integerDeserializer(), "skipped_due_to_no_data");
10021118

10031119
}
10041120

0 commit comments

Comments
 (0)