Skip to content

Commit 3e9d4ec

Browse files
committed
[codegen] Update to latest API spec
1 parent 3f72100 commit 3e9d4ec

Some content is hidden

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

47 files changed

+5334
-849
lines changed

java-client/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ dependencies {
220220

221221
// MIT
222222
// https://www.testcontainers.org/
223-
testImplementation("org.testcontainers", "testcontainers", "1.15.3")
224-
testImplementation("org.testcontainers", "elasticsearch", "1.15.3")
223+
testImplementation("org.testcontainers", "testcontainers", "1.16.3")
224+
testImplementation("org.testcontainers", "elasticsearch", "1.16.3")
225225
}
226226

227227

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

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -775,20 +775,6 @@ public final CompletableFuture<FieldCapsResponse> fieldCaps(
775775
return fieldCaps(fn.apply(new FieldCapsRequest.Builder()).build());
776776
}
777777

778-
/**
779-
* Returns the information about the capabilities of fields among multiple
780-
* indices.
781-
*
782-
* @see <a href=
783-
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html">Documentation
784-
* on elastic.co</a>
785-
*/
786-
787-
public CompletableFuture<FieldCapsResponse> fieldCaps() {
788-
return this.transport.performRequestAsync(new FieldCapsRequest.Builder().build(), FieldCapsRequest._ENDPOINT,
789-
this.transportOptions);
790-
}
791-
792778
// ----- Endpoint: get
793779

794780
/**
@@ -1274,21 +1260,6 @@ public final CompletableFuture<ReindexResponse> reindex(
12741260
return reindex(fn.apply(new ReindexRequest.Builder()).build());
12751261
}
12761262

1277-
/**
1278-
* Allows to copy documents from one index to another, optionally filtering the
1279-
* source documents by a query, changing the destination index settings, or
1280-
* fetching the documents from a remote cluster.
1281-
*
1282-
* @see <a href=
1283-
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html">Documentation
1284-
* on elastic.co</a>
1285-
*/
1286-
1287-
public CompletableFuture<ReindexResponse> reindex() {
1288-
return this.transport.performRequestAsync(new ReindexRequest.Builder().build(), ReindexRequest._ENDPOINT,
1289-
this.transportOptions);
1290-
}
1291-
12921263
// ----- Endpoint: reindex_rethrottle
12931264

12941265
/**

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

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -788,20 +788,6 @@ public final FieldCapsResponse fieldCaps(Function<FieldCapsRequest.Builder, Obje
788788
return fieldCaps(fn.apply(new FieldCapsRequest.Builder()).build());
789789
}
790790

791-
/**
792-
* Returns the information about the capabilities of fields among multiple
793-
* indices.
794-
*
795-
* @see <a href=
796-
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html">Documentation
797-
* on elastic.co</a>
798-
*/
799-
800-
public FieldCapsResponse fieldCaps() throws IOException, ElasticsearchException {
801-
return this.transport.performRequest(new FieldCapsRequest.Builder().build(), FieldCapsRequest._ENDPOINT,
802-
this.transportOptions);
803-
}
804-
805791
// ----- Endpoint: get
806792

807793
/**
@@ -1293,21 +1279,6 @@ public final ReindexResponse reindex(Function<ReindexRequest.Builder, ObjectBuil
12931279
return reindex(fn.apply(new ReindexRequest.Builder()).build());
12941280
}
12951281

1296-
/**
1297-
* Allows to copy documents from one index to another, optionally filtering the
1298-
* source documents by a query, changing the destination index settings, or
1299-
* fetching the documents from a remote cluster.
1300-
*
1301-
* @see <a href=
1302-
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html">Documentation
1303-
* on elastic.co</a>
1304-
*/
1305-
1306-
public ReindexResponse reindex() throws IOException, ElasticsearchException {
1307-
return this.transport.performRequest(new ReindexRequest.Builder().build(), ReindexRequest._ENDPOINT,
1308-
this.transportOptions);
1309-
}
1310-
13111282
// ----- Endpoint: reindex_rethrottle
13121283

13131284
/**

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

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@
2929
import co.elastic.clients.json.JsonpMapper;
3030
import co.elastic.clients.json.ObjectBuilderDeserializer;
3131
import co.elastic.clients.json.ObjectDeserializer;
32-
import co.elastic.clients.util.ApiTypeHelper;
3332
import co.elastic.clients.util.ObjectBuilder;
3433
import jakarta.json.stream.JsonGenerator;
3534
import java.lang.Integer;
3635
import java.lang.Long;
3736
import java.lang.String;
38-
import java.util.List;
3937
import java.util.Objects;
4038
import java.util.function.Function;
4139
import javax.annotation.Nullable;
@@ -68,7 +66,8 @@ public class SignificantTermsAggregation extends BucketAggregationBase implement
6866
@Nullable
6967
private final GoogleNormalizedDistanceHeuristic gnd;
7068

71-
private final List<String> include;
69+
@Nullable
70+
private final TermsInclude include;
7271

7372
@Nullable
7473
private final Long minDocCount;
@@ -102,7 +101,7 @@ private SignificantTermsAggregation(Builder builder) {
102101
this.executionHint = builder.executionHint;
103102
this.field = builder.field;
104103
this.gnd = builder.gnd;
105-
this.include = ApiTypeHelper.unmodifiable(builder.include);
104+
this.include = builder.include;
106105
this.minDocCount = builder.minDocCount;
107106
this.mutualInformation = builder.mutualInformation;
108107
this.percentage = builder.percentage;
@@ -176,7 +175,8 @@ public final GoogleNormalizedDistanceHeuristic gnd() {
176175
/**
177176
* API name: {@code include}
178177
*/
179-
public final List<String> include() {
178+
@Nullable
179+
public final TermsInclude include() {
180180
return this.include;
181181
}
182182

@@ -268,14 +268,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
268268
this.gnd.serialize(generator, mapper);
269269

270270
}
271-
if (ApiTypeHelper.isDefined(this.include)) {
271+
if (this.include != null) {
272272
generator.writeKey("include");
273-
generator.writeStartArray();
274-
for (String item0 : this.include) {
275-
generator.write(item0);
276-
277-
}
278-
generator.writeEnd();
273+
this.include.serialize(generator, mapper);
279274

280275
}
281276
if (this.minDocCount != null) {
@@ -344,7 +339,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder<Builde
344339
private GoogleNormalizedDistanceHeuristic gnd;
345340

346341
@Nullable
347-
private List<String> include;
342+
private TermsInclude include;
348343

349344
@Nullable
350345
private Long minDocCount;
@@ -446,22 +441,17 @@ public final Builder gnd(
446441

447442
/**
448443
* API name: {@code include}
449-
* <p>
450-
* Adds all elements of <code>list</code> to <code>include</code>.
451444
*/
452-
public final Builder include(List<String> list) {
453-
this.include = _listAddAll(this.include, list);
445+
public final Builder include(@Nullable TermsInclude value) {
446+
this.include = value;
454447
return this;
455448
}
456449

457450
/**
458451
* API name: {@code include}
459-
* <p>
460-
* Adds one or more values to <code>include</code>.
461452
*/
462-
public final Builder include(String value, String... values) {
463-
this.include = _listAdd(this.include, value, values);
464-
return this;
453+
public final Builder include(Function<TermsInclude.Builder, ObjectBuilder<TermsInclude>> fn) {
454+
return this.include(fn.apply(new TermsInclude.Builder()).build());
465455
}
466456

467457
/**
@@ -578,8 +568,7 @@ protected static void setupSignificantTermsAggregationDeserializer(
578568
op.add(Builder::executionHint, TermsAggregationExecutionHint._DESERIALIZER, "execution_hint");
579569
op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field");
580570
op.add(Builder::gnd, GoogleNormalizedDistanceHeuristic._DESERIALIZER, "gnd");
581-
op.add(Builder::include, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()),
582-
"include");
571+
op.add(Builder::include, TermsInclude._DESERIALIZER, "include");
583572
op.add(Builder::minDocCount, JsonpDeserializer.longDeserializer(), "min_doc_count");
584573
op.add(Builder::mutualInformation, MutualInformationHeuristic._DESERIALIZER, "mutual_information");
585574
op.add(Builder::percentage, PercentageScoreHeuristic._DESERIALIZER, "percentage");

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ public enum FieldType implements JsonEnum {
116116

117117
DenseVector("dense_vector"),
118118

119+
MatchOnlyText("match_only_text"),
120+
119121
;
120122

121123
private final String jsonValue;

0 commit comments

Comments
 (0)