Skip to content

Commit fe7347c

Browse files
[8.19] Regenerate client (#1173)
* [codegen] update to latest spec * revert unwanted changes --------- Co-authored-by: Laura Trotta <laura.trotta@elastic.co>
1 parent 2261d63 commit fe7347c

12 files changed

Lines changed: 481 additions & 121 deletions

File tree

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
@@ -92,6 +92,9 @@ public class KnnSearch implements JsonpSerializable {
9292
@Nullable
9393
private final RescoreVector rescoreVector;
9494

95+
@Nullable
96+
private final String queryName;
97+
9598
// ---------------------------------------------------------------------------------------------
9699

97100
private KnnSearch(Builder builder) {
@@ -106,6 +109,7 @@ private KnnSearch(Builder builder) {
106109
this.similarity = builder.similarity;
107110
this.innerHits = builder.innerHits;
108111
this.rescoreVector = builder.rescoreVector;
112+
this.queryName = builder.queryName;
109113

110114
}
111115

@@ -211,6 +215,14 @@ public final RescoreVector rescoreVector() {
211215
return this.rescoreVector;
212216
}
213217

218+
/**
219+
* API name: {@code _name}
220+
*/
221+
@Nullable
222+
public final String queryName() {
223+
return this.queryName;
224+
}
225+
214226
/**
215227
* Serialize this object to JSON.
216228
*/
@@ -280,6 +292,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
280292
this.rescoreVector.serialize(generator, mapper);
281293

282294
}
295+
if (this.queryName != null) {
296+
generator.writeKey("_name");
297+
generator.write(this.queryName);
298+
299+
}
283300

284301
}
285302

@@ -324,6 +341,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
324341
@Nullable
325342
private RescoreVector rescoreVector;
326343

344+
@Nullable
345+
private String queryName;
346+
327347
public Builder() {
328348
}
329349
private Builder(KnnSearch instance) {
@@ -337,6 +357,7 @@ private Builder(KnnSearch instance) {
337357
this.similarity = instance.similarity;
338358
this.innerHits = instance.innerHits;
339359
this.rescoreVector = instance.rescoreVector;
360+
this.queryName = instance.queryName;
340361

341362
}
342363
/**
@@ -534,6 +555,14 @@ public final Builder rescoreVector(Function<RescoreVector.Builder, ObjectBuilder
534555
return this.rescoreVector(fn.apply(new RescoreVector.Builder()).build());
535556
}
536557

558+
/**
559+
* API name: {@code _name}
560+
*/
561+
public final Builder queryName(@Nullable String value) {
562+
this.queryName = value;
563+
return this;
564+
}
565+
537566
@Override
538567
protected Builder self() {
539568
return this;
@@ -579,6 +608,7 @@ protected static void setupKnnSearchDeserializer(ObjectDeserializer<KnnSearch.Bu
579608
op.add(Builder::similarity, JsonpDeserializer.floatDeserializer(), "similarity");
580609
op.add(Builder::innerHits, InnerHits._DESERIALIZER, "inner_hits");
581610
op.add(Builder::rescoreVector, RescoreVector._DESERIALIZER, "rescore_vector");
611+
op.add(Builder::queryName, JsonpDeserializer.stringDeserializer(), "_name");
582612

583613
}
584614

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 String 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)