Skip to content

Commit 0ae148d

Browse files
committed
[codegen] update to latest spec
1 parent b31c9b5 commit 0ae148d

14 files changed

+1114
-285
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchStatusRequest.java

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import co.elastic.clients.elasticsearch._types.ErrorResponse;
2323
import co.elastic.clients.elasticsearch._types.RequestBase;
24+
import co.elastic.clients.elasticsearch._types.Time;
2425
import co.elastic.clients.json.JsonpDeserializable;
2526
import co.elastic.clients.json.JsonpDeserializer;
2627
import co.elastic.clients.json.ObjectBuilderDeserializer;
@@ -31,7 +32,6 @@
3132
import co.elastic.clients.util.ObjectBuilder;
3233
import jakarta.json.stream.JsonGenerator;
3334
import java.lang.String;
34-
import java.util.Collections;
3535
import java.util.HashMap;
3636
import java.util.Map;
3737
import java.util.Objects;
@@ -70,11 +70,15 @@
7070
public class AsyncSearchStatusRequest extends RequestBase {
7171
private final String id;
7272

73+
@Nullable
74+
private final Time keepAlive;
75+
7376
// ---------------------------------------------------------------------------------------------
7477

7578
private AsyncSearchStatusRequest(Builder builder) {
7679

7780
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
81+
this.keepAlive = builder.keepAlive;
7882

7983
}
8084

@@ -91,6 +95,17 @@ public final String id() {
9195
return this.id;
9296
}
9397

98+
/**
99+
* Specifies how long the async search needs to be available. Ongoing async
100+
* searches and any saved search results are deleted after this period.
101+
* <p>
102+
* API name: {@code keep_alive}
103+
*/
104+
@Nullable
105+
public final Time keepAlive() {
106+
return this.keepAlive;
107+
}
108+
94109
// ---------------------------------------------------------------------------------------------
95110

96111
/**
@@ -102,6 +117,9 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder>
102117
ObjectBuilder<AsyncSearchStatusRequest> {
103118
private String id;
104119

120+
@Nullable
121+
private Time keepAlive;
122+
105123
/**
106124
* Required - A unique identifier for the async search.
107125
* <p>
@@ -112,6 +130,27 @@ public final Builder id(String value) {
112130
return this;
113131
}
114132

133+
/**
134+
* Specifies how long the async search needs to be available. Ongoing async
135+
* searches and any saved search results are deleted after this period.
136+
* <p>
137+
* API name: {@code keep_alive}
138+
*/
139+
public final Builder keepAlive(@Nullable Time value) {
140+
this.keepAlive = value;
141+
return this;
142+
}
143+
144+
/**
145+
* Specifies how long the async search needs to be available. Ongoing async
146+
* searches and any saved search results are deleted after this period.
147+
* <p>
148+
* API name: {@code keep_alive}
149+
*/
150+
public final Builder keepAlive(Function<Time.Builder, ObjectBuilder<Time>> fn) {
151+
return this.keepAlive(fn.apply(new Time.Builder()).build());
152+
}
153+
115154
@Override
116155
protected Builder self() {
117156
return this;
@@ -181,7 +220,11 @@ public AsyncSearchStatusRequest build() {
181220

182221
// Request parameters
183222
request -> {
184-
return Collections.emptyMap();
223+
Map<String, String> params = new HashMap<>();
224+
if (request.keepAlive != null) {
225+
params.put("keep_alive", request.keepAlive._toJsonString());
226+
}
227+
return params;
185228

186229
}, SimpleEndpoint.emptyMap(), false, AsyncSearchStatusResponse._DESERIALIZER);
187230
}

java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java

Lines changed: 0 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ public class SubmitRequest extends RequestBase implements JsonpSerializable {
164164

165165
private final List<Map<String, Double>> indicesBoost;
166166

167-
@Nullable
168-
private final Time keepAlive;
169-
170167
@Nullable
171168
private final Boolean keepOnCompletion;
172169

@@ -190,9 +187,6 @@ public class SubmitRequest extends RequestBase implements JsonpSerializable {
190187
@Nullable
191188
private final Query postFilter;
192189

193-
@Nullable
194-
private final Long preFilterShardSize;
195-
196190
@Nullable
197191
private final String preference;
198192

@@ -217,9 +211,6 @@ public class SubmitRequest extends RequestBase implements JsonpSerializable {
217211

218212
private final Map<String, ScriptField> scriptFields;
219213

220-
@Nullable
221-
private final Time scroll;
222-
223214
private final List<FieldValue> searchAfter;
224215

225216
@Nullable
@@ -287,7 +278,6 @@ private SubmitRequest(Builder builder) {
287278
this.ignoreUnavailable = builder.ignoreUnavailable;
288279
this.index = ApiTypeHelper.unmodifiable(builder.index);
289280
this.indicesBoost = ApiTypeHelper.unmodifiable(builder.indicesBoost);
290-
this.keepAlive = builder.keepAlive;
291281
this.keepOnCompletion = builder.keepOnCompletion;
292282
this.knn = ApiTypeHelper.unmodifiable(builder.knn);
293283
this.lenient = builder.lenient;
@@ -296,7 +286,6 @@ private SubmitRequest(Builder builder) {
296286
this.minScore = builder.minScore;
297287
this.pit = builder.pit;
298288
this.postFilter = builder.postFilter;
299-
this.preFilterShardSize = builder.preFilterShardSize;
300289
this.preference = builder.preference;
301290
this.profile = builder.profile;
302291
this.q = builder.q;
@@ -306,7 +295,6 @@ private SubmitRequest(Builder builder) {
306295
this.routing = builder.routing;
307296
this.runtimeMappings = ApiTypeHelper.unmodifiable(builder.runtimeMappings);
308297
this.scriptFields = ApiTypeHelper.unmodifiable(builder.scriptFields);
309-
this.scroll = builder.scroll;
310298
this.searchAfter = ApiTypeHelper.unmodifiable(builder.searchAfter);
311299
this.searchType = builder.searchType;
312300
this.seqNoPrimaryTerm = builder.seqNoPrimaryTerm;
@@ -554,17 +542,6 @@ public final List<Map<String, Double>> indicesBoost() {
554542
return this.indicesBoost;
555543
}
556544

557-
/**
558-
* Specifies how long the async search needs to be available. Ongoing async
559-
* searches and any saved search results are deleted after this period.
560-
* <p>
561-
* API name: {@code keep_alive}
562-
*/
563-
@Nullable
564-
public final Time keepAlive() {
565-
return this.keepAlive;
566-
}
567-
568545
/**
569546
* If <code>true</code>, results are stored for later retrieval when the search
570547
* completes within the <code>wait_for_completion_timeout</code>.
@@ -646,18 +623,6 @@ public final Query postFilter() {
646623
return this.postFilter;
647624
}
648625

649-
/**
650-
* The default value cannot be changed, which enforces the execution of a
651-
* pre-filter roundtrip to retrieve statistics from each shard so that the ones
652-
* that surely don’t hold any document matching the query get skipped.
653-
* <p>
654-
* API name: {@code pre_filter_shard_size}
655-
*/
656-
@Nullable
657-
public final Long preFilterShardSize() {
658-
return this.preFilterShardSize;
659-
}
660-
661626
/**
662627
* Specify the node or shard the operation should be performed on (default:
663628
* random)
@@ -744,14 +709,6 @@ public final Map<String, ScriptField> scriptFields() {
744709
return this.scriptFields;
745710
}
746711

747-
/**
748-
* API name: {@code scroll}
749-
*/
750-
@Nullable
751-
public final Time scroll() {
752-
return this.scroll;
753-
}
754-
755712
/**
756713
* API name: {@code search_after}
757714
*/
@@ -1239,9 +1196,6 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder> impleme
12391196
@Nullable
12401197
private List<Map<String, Double>> indicesBoost;
12411198

1242-
@Nullable
1243-
private Time keepAlive;
1244-
12451199
@Nullable
12461200
private Boolean keepOnCompletion;
12471201

@@ -1266,9 +1220,6 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder> impleme
12661220
@Nullable
12671221
private Query postFilter;
12681222

1269-
@Nullable
1270-
private Long preFilterShardSize;
1271-
12721223
@Nullable
12731224
private String preference;
12741225

@@ -1296,9 +1247,6 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder> impleme
12961247
@Nullable
12971248
private Map<String, ScriptField> scriptFields;
12981249

1299-
@Nullable
1300-
private Time scroll;
1301-
13021250
@Nullable
13031251
private List<FieldValue> searchAfter;
13041252

@@ -1733,27 +1681,6 @@ public final Builder indicesBoost(Map<String, Double> value, Map<String, Double>
17331681
return this;
17341682
}
17351683

1736-
/**
1737-
* Specifies how long the async search needs to be available. Ongoing async
1738-
* searches and any saved search results are deleted after this period.
1739-
* <p>
1740-
* API name: {@code keep_alive}
1741-
*/
1742-
public final Builder keepAlive(@Nullable Time value) {
1743-
this.keepAlive = value;
1744-
return this;
1745-
}
1746-
1747-
/**
1748-
* Specifies how long the async search needs to be available. Ongoing async
1749-
* searches and any saved search results are deleted after this period.
1750-
* <p>
1751-
* API name: {@code keep_alive}
1752-
*/
1753-
public final Builder keepAlive(Function<Time.Builder, ObjectBuilder<Time>> fn) {
1754-
return this.keepAlive(fn.apply(new Time.Builder()).build());
1755-
}
1756-
17571684
/**
17581685
* If <code>true</code>, results are stored for later retrieval when the search
17591686
* completes within the <code>wait_for_completion_timeout</code>.
@@ -1878,18 +1805,6 @@ public final Builder postFilter(Function<Query.Builder, ObjectBuilder<Query>> fn
18781805
return this.postFilter(fn.apply(new Query.Builder()).build());
18791806
}
18801807

1881-
/**
1882-
* The default value cannot be changed, which enforces the execution of a
1883-
* pre-filter roundtrip to retrieve statistics from each shard so that the ones
1884-
* that surely don’t hold any document matching the query get skipped.
1885-
* <p>
1886-
* API name: {@code pre_filter_shard_size}
1887-
*/
1888-
public final Builder preFilterShardSize(@Nullable Long value) {
1889-
this.preFilterShardSize = value;
1890-
return this;
1891-
}
1892-
18931808
/**
18941809
* Specify the node or shard the operation should be performed on (default:
18951810
* random)
@@ -2062,21 +1977,6 @@ public final Builder scriptFields(String key, Function<ScriptField.Builder, Obje
20621977
return scriptFields(key, fn.apply(new ScriptField.Builder()).build());
20631978
}
20641979

2065-
/**
2066-
* API name: {@code scroll}
2067-
*/
2068-
public final Builder scroll(@Nullable Time value) {
2069-
this.scroll = value;
2070-
return this;
2071-
}
2072-
2073-
/**
2074-
* API name: {@code scroll}
2075-
*/
2076-
public final Builder scroll(Function<Time.Builder, ObjectBuilder<Time>> fn) {
2077-
return this.scroll(fn.apply(new Time.Builder()).build());
2078-
}
2079-
20801980
/**
20811981
* API name: {@code search_after}
20821982
* <p>
@@ -2544,9 +2444,6 @@ protected static void setupSubmitRequestDeserializer(ObjectDeserializer<SubmitRe
25442444
if (request.df != null) {
25452445
params.put("df", request.df);
25462446
}
2547-
if (request.preFilterShardSize != null) {
2548-
params.put("pre_filter_shard_size", String.valueOf(request.preFilterShardSize));
2549-
}
25502447
if (request.minCompatibleShardNode != null) {
25512448
params.put("min_compatible_shard_node", request.minCompatibleShardNode);
25522449
}
@@ -2587,9 +2484,6 @@ protected static void setupSubmitRequestDeserializer(ObjectDeserializer<SubmitRe
25872484
if (request.analyzeWildcard != null) {
25882485
params.put("analyze_wildcard", String.valueOf(request.analyzeWildcard));
25892486
}
2590-
if (request.scroll != null) {
2591-
params.put("scroll", request.scroll._toJsonString());
2592-
}
25932487
if (request.waitForCompletionTimeout != null) {
25942488
params.put("wait_for_completion_timeout", request.waitForCompletionTimeout._toJsonString());
25952489
}
@@ -2605,9 +2499,6 @@ protected static void setupSubmitRequestDeserializer(ObjectDeserializer<SubmitRe
26052499
if (request.defaultOperator != null) {
26062500
params.put("default_operator", request.defaultOperator.jsonValue());
26072501
}
2608-
if (request.keepAlive != null) {
2609-
params.put("keep_alive", request.keepAlive._toJsonString());
2610-
}
26112502
if (request.requestCache != null) {
26122503
params.put("request_cache", String.valueOf(request.requestCache));
26132504
}

0 commit comments

Comments
 (0)