diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/core/SearchRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/core/SearchRequest.java index 3b7166c1fc..e1a47ab883 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/core/SearchRequest.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/core/SearchRequest.java @@ -110,6 +110,9 @@ public class SearchRequest extends RequestBase implements PlainJsonSerializable @Nullable private final String pipeline; + @Nullable + private final Time cancelAfterTimeInterval; + @Nullable private final FieldCollapse collapse; @@ -246,6 +249,7 @@ private SearchRequest(Builder builder) { this.ccsMinimizeRoundtrips = builder.ccsMinimizeRoundtrips; this.phaseTook = builder.phaseTook; this.pipeline = builder.pipeline; + this.cancelAfterTimeInterval = builder.cancelAfterTimeInterval; this.collapse = builder.collapse; this.defaultOperator = builder.defaultOperator; this.df = builder.df; @@ -405,6 +409,17 @@ public final String pipeline() { return this.pipeline; } + /** + * The time after which the search request will be canceled. + * Request-level parameter takes precedence over cancel_after_time_interval cluster setting. + *
+ * API name: {@code cancel_after_time_interval}
+ */
+ @Nullable
+ public final Time cancelAfterTimeInterval() {
+ return this.cancelAfterTimeInterval;
+ }
+
/**
* API name: {@code collapse}
*/
@@ -1114,6 +1129,7 @@ public Builder toBuilder() {
.ccsMinimizeRoundtrips(ccsMinimizeRoundtrips)
.phaseTook(phaseTook)
.pipeline(pipeline)
+ .cancelAfterTimeInterval(cancelAfterTimeInterval)
.collapse(collapse)
.defaultOperator(defaultOperator)
.df(df)
@@ -1198,6 +1214,9 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder
+ * API name: {@code cancel_after_time_interval}
+ */
+ public final Builder cancelAfterTimeInterval(@Nullable Time value) {
+ this.cancelAfterTimeInterval = value;
+ return this;
+ }
+
+ /**
+ * The time after which the search request will be canceled.
+ * Request-level parameter takes precedence over cancel_after_time_interval cluster setting.
+ *
+ * API name: {@code cancel_after_time_interval}
+ */
+ public final Builder cancelAfterTimeInterval(Function