Skip to content

Commit 32d66bc

Browse files
committed
[codegen] update to latest api spec
1 parent 7044165 commit 32d66bc

File tree

109 files changed

+5307
-1630
lines changed

Some content is hidden

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

109 files changed

+5307
-1630
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java

+145-100
Large diffs are not rendered by default.

java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java

+145-100
Large diffs are not rendered by default.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public static <TDocument> JsonpDeserializer<InlineGet<TDocument>> createInlineGe
377377
*/
378378
public static final JsonpDeserializer<InlineGet<Object>> _DESERIALIZER = JsonpDeserializer
379379
.lazy(() -> createInlineGetDeserializer(
380-
new NamedDeserializer<>("co.elastic.clients:Deserializer:_types.TDocument")));
380+
new NamedDeserializer<>("co.elastic.clients:Deserializer:_types.InlineGet.TDocument")));
381381

382382
protected static <TDocument> void setupInlineGetDeserializer(ObjectDeserializer<InlineGet.Builder<TDocument>> op,
383383
JsonpDeserializer<TDocument> tDocumentDeserializer) {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public enum CalendarInterval implements JsonEnum {
6060

6161
Quarter("quarter", "1q"),
6262

63-
Year("year", "1Y"),
63+
Year("year", "1y"),
6464

6565
;
6666

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public static <T> JsonpDeserializer<ExtendedBounds<T>> createExtendedBoundsDeser
215215
*/
216216
public static final JsonpDeserializer<ExtendedBounds<Object>> _DESERIALIZER = JsonpDeserializer
217217
.lazy(() -> createExtendedBoundsDeserializer(
218-
new NamedDeserializer<>("co.elastic.clients:Deserializer:_types.aggregations.T")));
218+
new NamedDeserializer<>("co.elastic.clients:Deserializer:_types.aggregations.ExtendedBounds.T")));
219219

220220
protected static <T> void setupExtendedBoundsDeserializer(ObjectDeserializer<ExtendedBounds.Builder<T>> op,
221221
JsonpDeserializer<T> tDeserializer) {

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

+40
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import jakarta.json.stream.JsonGenerator;
4040
import java.lang.Boolean;
4141
import java.lang.Integer;
42+
import java.lang.Long;
4243
import java.lang.String;
4344
import java.util.List;
4445
import java.util.Objects;
@@ -110,6 +111,9 @@ public class TermsAggregation extends BucketAggregationBase
110111
@Nullable
111112
private final Script script;
112113

114+
@Nullable
115+
private final Long shardMinDocCount;
116+
113117
@Nullable
114118
private final Integer shardSize;
115119

@@ -138,6 +142,7 @@ private TermsAggregation(Builder builder) {
138142
this.valueType = builder.valueType;
139143
this.order = ApiTypeHelper.unmodifiable(builder.order);
140144
this.script = builder.script;
145+
this.shardMinDocCount = builder.shardMinDocCount;
141146
this.shardSize = builder.shardSize;
142147
this.showTermDocCountError = builder.showTermDocCountError;
143148
this.size = builder.size;
@@ -291,6 +296,19 @@ public final Script script() {
291296
return this.script;
292297
}
293298

299+
/**
300+
* Regulates the certainty a shard has if the term should actually be added to
301+
* the candidate list or not with respect to the <code>min_doc_count</code>.
302+
* Terms will only be considered if their local shard frequency within the set
303+
* is higher than the <code>shard_min_doc_count</code>.
304+
* <p>
305+
* API name: {@code shard_min_doc_count}
306+
*/
307+
@Nullable
308+
public final Long shardMinDocCount() {
309+
return this.shardMinDocCount;
310+
}
311+
294312
/**
295313
* The number of candidate terms produced by each shard. By default,
296314
* <code>shard_size</code> will be automatically estimated based on the number
@@ -408,6 +426,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
408426
generator.writeKey("script");
409427
this.script.serialize(generator, mapper);
410428

429+
}
430+
if (this.shardMinDocCount != null) {
431+
generator.writeKey("shard_min_doc_count");
432+
generator.write(this.shardMinDocCount);
433+
411434
}
412435
if (this.shardSize != null) {
413436
generator.writeKey("shard_size");
@@ -482,6 +505,9 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder<Builde
482505
@Nullable
483506
private Script script;
484507

508+
@Nullable
509+
private Long shardMinDocCount;
510+
485511
@Nullable
486512
private Integer shardSize;
487513

@@ -707,6 +733,19 @@ public final Builder script(Function<Script.Builder, ObjectBuilder<Script>> fn)
707733
return this.script(fn.apply(new Script.Builder()).build());
708734
}
709735

736+
/**
737+
* Regulates the certainty a shard has if the term should actually be added to
738+
* the candidate list or not with respect to the <code>min_doc_count</code>.
739+
* Terms will only be considered if their local shard frequency within the set
740+
* is higher than the <code>shard_min_doc_count</code>.
741+
* <p>
742+
* API name: {@code shard_min_doc_count}
743+
*/
744+
public final Builder shardMinDocCount(@Nullable Long value) {
745+
this.shardMinDocCount = value;
746+
return this;
747+
}
748+
710749
/**
711750
* The number of candidate terms produced by each shard. By default,
712751
* <code>shard_size</code> will be automatically estimated based on the number
@@ -790,6 +829,7 @@ protected static void setupTermsAggregationDeserializer(ObjectDeserializer<Terms
790829
op.add(Builder::order,
791830
JsonpDeserializer.arrayDeserializer(NamedValue.deserializer(() -> SortOrder._DESERIALIZER)), "order");
792831
op.add(Builder::script, Script._DESERIALIZER, "script");
832+
op.add(Builder::shardMinDocCount, JsonpDeserializer.longDeserializer(), "shard_min_doc_count");
793833
op.add(Builder::shardSize, JsonpDeserializer.integerDeserializer(), "shard_size");
794834
op.add(Builder::showTermDocCountError, JsonpDeserializer.booleanDeserializer(), "show_term_doc_count_error");
795835
op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size");

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

+2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ public enum FieldType implements JsonEnum {
129129

130130
DenseVector("dense_vector"),
131131

132+
SemanticText("semantic_text"),
133+
132134
SparseVector("sparse_vector"),
133135

134136
MatchOnlyText("match_only_text"),

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

+31
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ public enum Kind implements JsonEnum {
152152

153153
SearchAsYouType("search_as_you_type"),
154154

155+
SemanticText("semantic_text"),
156+
155157
Shape("shape"),
156158

157159
Short("short"),
@@ -913,6 +915,23 @@ public SearchAsYouTypeProperty searchAsYouType() {
913915
return TaggedUnionUtils.get(this, Kind.SearchAsYouType);
914916
}
915917

918+
/**
919+
* Is this variant instance of kind {@code semantic_text}?
920+
*/
921+
public boolean isSemanticText() {
922+
return _kind == Kind.SemanticText;
923+
}
924+
925+
/**
926+
* Get the {@code semantic_text} variant value.
927+
*
928+
* @throws IllegalStateException
929+
* if the current variant is not of the {@code semantic_text} kind.
930+
*/
931+
public SemanticTextProperty semanticText() {
932+
return TaggedUnionUtils.get(this, Kind.SemanticText);
933+
}
934+
916935
/**
917936
* Is this variant instance of kind {@code shape}?
918937
*/
@@ -1529,6 +1548,17 @@ public ObjectBuilder<Property> searchAsYouType(
15291548
return this.searchAsYouType(fn.apply(new SearchAsYouTypeProperty.Builder()).build());
15301549
}
15311550

1551+
public ObjectBuilder<Property> semanticText(SemanticTextProperty v) {
1552+
this._kind = Kind.SemanticText;
1553+
this._value = v;
1554+
return this;
1555+
}
1556+
1557+
public ObjectBuilder<Property> semanticText(
1558+
Function<SemanticTextProperty.Builder, ObjectBuilder<SemanticTextProperty>> fn) {
1559+
return this.semanticText(fn.apply(new SemanticTextProperty.Builder()).build());
1560+
}
1561+
15321562
public ObjectBuilder<Property> shape(ShapeProperty v) {
15331563
this._kind = Kind.Shape;
15341564
this._value = v;
@@ -1679,6 +1709,7 @@ protected static void setupPropertyDeserializer(ObjectDeserializer<Builder> op)
16791709
op.add(Builder::rankFeatures, RankFeaturesProperty._DESERIALIZER, "rank_features");
16801710
op.add(Builder::scaledFloat, ScaledFloatNumberProperty._DESERIALIZER, "scaled_float");
16811711
op.add(Builder::searchAsYouType, SearchAsYouTypeProperty._DESERIALIZER, "search_as_you_type");
1712+
op.add(Builder::semanticText, SemanticTextProperty._DESERIALIZER, "semantic_text");
16821713
op.add(Builder::shape, ShapeProperty._DESERIALIZER, "shape");
16831714
op.add(Builder::short_, ShortNumberProperty._DESERIALIZER, "short");
16841715
op.add(Builder::sparseVector, SparseVectorProperty._DESERIALIZER, "sparse_vector");

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

+19
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,25 @@ public static Property searchAsYouType(
767767
return builder.build();
768768
}
769769

770+
/**
771+
* Creates a builder for the {@link SemanticTextProperty semantic_text}
772+
* {@code Property} variant.
773+
*/
774+
public static SemanticTextProperty.Builder semanticText() {
775+
return new SemanticTextProperty.Builder();
776+
}
777+
778+
/**
779+
* Creates a Property of the {@link SemanticTextProperty semantic_text}
780+
* {@code Property} variant.
781+
*/
782+
public static Property semanticText(
783+
Function<SemanticTextProperty.Builder, ObjectBuilder<SemanticTextProperty>> fn) {
784+
Property.Builder builder = new Property.Builder();
785+
builder.semanticText(fn.apply(new SemanticTextProperty.Builder()).build());
786+
return builder.build();
787+
}
788+
770789
/**
771790
* Creates a builder for the {@link ShapeProperty shape} {@code Property}
772791
* variant.

0 commit comments

Comments
 (0)