Skip to content

Commit 1341b30

Browse files
[codegen] update to latest spec (#1162)
Co-authored-by: Laura Trotta <laura.trotta@elastic.co>
1 parent a53a930 commit 1341b30

File tree

102 files changed

+3257
-3229
lines changed

Some content is hidden

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

102 files changed

+3257
-3229
lines changed

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

Lines changed: 108 additions & 108 deletions
Large diffs are not rendered by default.

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

Lines changed: 108 additions & 108 deletions
Large diffs are not rendered by default.

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ public class KnnSearch implements JsonpSerializable {
9595
@Nullable
9696
private final RescoreVector rescoreVector;
9797

98+
@Nullable
99+
private final String queryName;
100+
98101
// ---------------------------------------------------------------------------------------------
99102

100103
private KnnSearch(Builder builder) {
@@ -110,6 +113,7 @@ private KnnSearch(Builder builder) {
110113
this.similarity = builder.similarity;
111114
this.innerHits = builder.innerHits;
112115
this.rescoreVector = builder.rescoreVector;
116+
this.queryName = builder.queryName;
113117

114118
}
115119

@@ -226,6 +230,14 @@ public final RescoreVector rescoreVector() {
226230
return this.rescoreVector;
227231
}
228232

233+
/**
234+
* API name: {@code _name}
235+
*/
236+
@Nullable
237+
public final String queryName() {
238+
return this.queryName;
239+
}
240+
229241
/**
230242
* Serialize this object to JSON.
231243
*/
@@ -300,6 +312,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
300312
this.rescoreVector.serialize(generator, mapper);
301313

302314
}
315+
if (this.queryName != null) {
316+
generator.writeKey("_name");
317+
generator.write(this.queryName);
318+
319+
}
303320

304321
}
305322

@@ -347,6 +364,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
347364
@Nullable
348365
private RescoreVector rescoreVector;
349366

367+
@Nullable
368+
private String queryName;
369+
350370
public Builder() {
351371
}
352372
private Builder(KnnSearch instance) {
@@ -361,6 +381,7 @@ private Builder(KnnSearch instance) {
361381
this.similarity = instance.similarity;
362382
this.innerHits = instance.innerHits;
363383
this.rescoreVector = instance.rescoreVector;
384+
this.queryName = instance.queryName;
364385

365386
}
366387
/**
@@ -569,6 +590,14 @@ public final Builder rescoreVector(Function<RescoreVector.Builder, ObjectBuilder
569590
return this.rescoreVector(fn.apply(new RescoreVector.Builder()).build());
570591
}
571592

593+
/**
594+
* API name: {@code _name}
595+
*/
596+
public final Builder queryName(@Nullable String value) {
597+
this.queryName = value;
598+
return this;
599+
}
600+
572601
@Override
573602
protected Builder self() {
574603
return this;
@@ -615,6 +644,7 @@ protected static void setupKnnSearchDeserializer(ObjectDeserializer<KnnSearch.Bu
615644
op.add(Builder::similarity, JsonpDeserializer.floatDeserializer(), "similarity");
616645
op.add(Builder::innerHits, InnerHits._DESERIALIZER, "inner_hits");
617646
op.add(Builder::rescoreVector, RescoreVector._DESERIALIZER, "rescore_vector");
647+
op.add(Builder::queryName, JsonpDeserializer.stringDeserializer(), "_name");
618648

619649
}
620650

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
package co.elastic.clients.elasticsearch._types;
2121

22+
import co.elastic.clients.elasticsearch._types.aggregations.MultiTermLookup;
23+
import co.elastic.clients.elasticsearch._types.aggregations.MultiTermLookupVariant;
2224
import co.elastic.clients.elasticsearch._types.query_dsl.IntervalsFilter;
2325
import co.elastic.clients.elasticsearch._types.query_dsl.IntervalsFilterVariant;
2426
import co.elastic.clients.json.JsonData;
@@ -61,7 +63,7 @@
6163
* @see <a href="../doc-files/api-spec.html#_types.Script">API specification</a>
6264
*/
6365
@JsonpDeserializable
64-
public class Script implements IntervalsFilterVariant, JsonpSerializable {
66+
public class Script implements IntervalsFilterVariant, MultiTermLookupVariant, JsonpSerializable {
6567
@Nullable
6668
private final ScriptSource source;
6769

@@ -99,6 +101,14 @@ public IntervalsFilter.Kind _intervalsFilterKind() {
99101
return IntervalsFilter.Kind.Script;
100102
}
101103

104+
/**
105+
* MultiTermLookup variant kind.
106+
*/
107+
@Override
108+
public MultiTermLookup.Kind _multiTermLookupKind() {
109+
return MultiTermLookup.Kind.Script;
110+
}
111+
102112
/**
103113
* The script source.
104114
* <p>

0 commit comments

Comments
 (0)