diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchStatusRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchStatusRequest.java
index eca1c109a..f0151830e 100644
--- a/java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchStatusRequest.java
+++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchStatusRequest.java
@@ -21,6 +21,7 @@
import co.elastic.clients.elasticsearch._types.ErrorResponse;
import co.elastic.clients.elasticsearch._types.RequestBase;
+import co.elastic.clients.elasticsearch._types.Time;
import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;
import co.elastic.clients.json.ObjectBuilderDeserializer;
@@ -31,7 +32,6 @@
import co.elastic.clients.util.ObjectBuilder;
import jakarta.json.stream.JsonGenerator;
import java.lang.String;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@@ -70,11 +70,15 @@
public class AsyncSearchStatusRequest extends RequestBase {
private final String id;
+ @Nullable
+ private final Time keepAlive;
+
// ---------------------------------------------------------------------------------------------
private AsyncSearchStatusRequest(Builder builder) {
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
+ this.keepAlive = builder.keepAlive;
}
@@ -91,6 +95,17 @@ public final String id() {
return this.id;
}
+ /**
+ * Specifies how long the async search needs to be available. Ongoing async
+ * searches and any saved search results are deleted after this period.
+ *
+ * API name: {@code keep_alive}
+ */
+ @Nullable
+ public final Time keepAlive() {
+ return this.keepAlive;
+ }
+
// ---------------------------------------------------------------------------------------------
/**
@@ -102,6 +117,9 @@ public static class Builder extends RequestBase.AbstractBuilder
ObjectBuilder {
private String id;
+ @Nullable
+ private Time keepAlive;
+
/**
* Required - A unique identifier for the async search.
*
@@ -112,6 +130,27 @@ public final Builder id(String value) {
return this;
}
+ /**
+ * Specifies how long the async search needs to be available. Ongoing async
+ * searches and any saved search results are deleted after this period.
+ *
+ * API name: {@code keep_alive}
+ */
+ public final Builder keepAlive(@Nullable Time value) {
+ this.keepAlive = value;
+ return this;
+ }
+
+ /**
+ * Specifies how long the async search needs to be available. Ongoing async
+ * searches and any saved search results are deleted after this period.
+ *
+ * API name: {@code keep_alive}
+ */
+ public final Builder keepAlive(Function> fn) {
+ return this.keepAlive(fn.apply(new Time.Builder()).build());
+ }
+
@Override
protected Builder self() {
return this;
@@ -181,7 +220,11 @@ public AsyncSearchStatusRequest build() {
// Request parameters
request -> {
- return Collections.emptyMap();
+ Map params = new HashMap<>();
+ if (request.keepAlive != null) {
+ params.put("keep_alive", request.keepAlive._toJsonString());
+ }
+ return params;
}, SimpleEndpoint.emptyMap(), false, AsyncSearchStatusResponse._DESERIALIZER);
}
diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java
index e69c4bc97..f6d697999 100644
--- a/java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java
+++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java
@@ -164,9 +164,6 @@ public class SubmitRequest extends RequestBase implements JsonpSerializable {
private final List