From 1adc552d9f3e69972cc91e6c0ef9b9f0fc26e896 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Mon, 5 Oct 2026 10:34:22 +0000 Subject: [PATCH] [codegen] update to latest spec --- .../_types/query_dsl/KqlQuery.java | 278 ++++++++++++++++++ .../elasticsearch/_types/query_dsl/Query.java | 30 ++ .../_types/query_dsl/QueryBuilders.java | 16 + .../elasticsearch/doc-files/api-spec.html | 49 +-- .../elasticsearch/ml/DatafeedConfig.java | 49 +++ .../elasticsearch/ml/PutDatafeedRequest.java | 49 +++ .../elasticsearch/ml/PutDatafeedResponse.java | 30 ++ .../ml/UpdateDatafeedRequest.java | 49 +++ .../ml/UpdateDatafeedResponse.java | 30 ++ 9 files changed, 556 insertions(+), 24 deletions(-) create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/KqlQuery.java diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/KqlQuery.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/KqlQuery.java new file mode 100644 index 0000000000..22ec6a6bf5 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/KqlQuery.java @@ -0,0 +1,278 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.query_dsl; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.query_dsl.KqlQuery + +/** + * Returns documents matching a provided Kibana Query Language (KQL) expression. + * The expression is parsed and rewritten into standard Query DSL. + * + * @see API + * specification + */ +@JsonpDeserializable +public class KqlQuery extends QueryBase implements QueryVariant { + @Nullable + private final Boolean caseInsensitive; + + @Nullable + private final String defaultField; + + private final String query; + + @Nullable + private final String timeZone; + + // --------------------------------------------------------------------------------------------- + + private KqlQuery(Builder builder) { + super(builder); + + this.caseInsensitive = builder.caseInsensitive; + this.defaultField = builder.defaultField; + this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query"); + this.timeZone = builder.timeZone; + + } + + public static KqlQuery of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Query variant kind. + */ + @Override + public Query.Kind _queryKind() { + return Query.Kind.Kql; + } + + /** + * If true, performs case-insensitive matching for field names and + * keyword or text terms. + *

+ * API name: {@code case_insensitive} + */ + @Nullable + public final Boolean caseInsensitive() { + return this.caseInsensitive; + } + + /** + * Default field, or field pattern with wildcards, to target when a bare term + * does not specify a field. Defaults to the + * index.query.default_field index setting, which has a default + * value of *. + *

+ * API name: {@code default_field} + */ + @Nullable + public final String defaultField() { + return this.defaultField; + } + + /** + * Required - The KQL expression to parse. + *

+ * API name: {@code query} + */ + public final String query() { + return this.query; + } + + /** + * Coordinated Universal Time (UTC) offset or IANA time zone used to interpret + * date literals in the expression. + *

+ * API name: {@code time_zone} + */ + @Nullable + public final String timeZone() { + return this.timeZone; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + super.serializeInternal(generator, mapper); + if (this.caseInsensitive != null) { + generator.writeKey("case_insensitive"); + generator.write(this.caseInsensitive); + + } + if (this.defaultField != null) { + generator.writeKey("default_field"); + generator.write(this.defaultField); + + } + generator.writeKey("query"); + generator.write(this.query); + + if (this.timeZone != null) { + generator.writeKey("time_zone"); + generator.write(this.timeZone); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link KqlQuery}. + */ + + public static class Builder extends QueryBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private Boolean caseInsensitive; + + @Nullable + private String defaultField; + + private String query; + + @Nullable + private String timeZone; + + public Builder() { + } + private Builder(KqlQuery instance) { + this.caseInsensitive = instance.caseInsensitive; + this.defaultField = instance.defaultField; + this.query = instance.query; + this.timeZone = instance.timeZone; + + } + /** + * If true, performs case-insensitive matching for field names and + * keyword or text terms. + *

+ * API name: {@code case_insensitive} + */ + public final Builder caseInsensitive(@Nullable Boolean value) { + this.caseInsensitive = value; + return this; + } + + /** + * Default field, or field pattern with wildcards, to target when a bare term + * does not specify a field. Defaults to the + * index.query.default_field index setting, which has a default + * value of *. + *

+ * API name: {@code default_field} + */ + public final Builder defaultField(@Nullable String value) { + this.defaultField = value; + return this; + } + + /** + * Required - The KQL expression to parse. + *

+ * API name: {@code query} + */ + public final Builder query(String value) { + this.query = value; + return this; + } + + /** + * Coordinated Universal Time (UTC) offset or IANA time zone used to interpret + * date literals in the expression. + *

+ * API name: {@code time_zone} + */ + public final Builder timeZone(@Nullable String value) { + this.timeZone = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link KqlQuery}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public KqlQuery build() { + _checkSingleUse(); + + return new KqlQuery(this); + } + } + + /** + * @return New {@link Builder} initialized with field values of this instance + */ + public Builder rebuild() { + return new Builder(this); + } + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link KqlQuery} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + KqlQuery::setupKqlQueryDeserializer); + + protected static void setupKqlQueryDeserializer(ObjectDeserializer op) { + QueryBase.setupQueryBaseDeserializer(op); + op.add(Builder::caseInsensitive, JsonpDeserializer.booleanDeserializer(), "case_insensitive"); + op.add(Builder::defaultField, JsonpDeserializer.stringDeserializer(), "default_field"); + op.add(Builder::query, JsonpDeserializer.stringDeserializer(), "query"); + op.add(Builder::timeZone, JsonpDeserializer.stringDeserializer(), "time_zone"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Query.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Query.java index d1f8186b59..db135901f8 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Query.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Query.java @@ -119,6 +119,8 @@ public enum Kind implements JsonEnum { Knn("knn"), + Kql("kql"), + Match("match"), MatchAll("match_all"), @@ -602,6 +604,23 @@ public KnnQuery knn() { return TaggedUnionUtils.get(this, Kind.Knn); } + /** + * Is this variant instance of kind {@code kql}? + */ + public boolean isKql() { + return _kind == Kind.Kql; + } + + /** + * Get the {@code kql} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code kql} kind. + */ + public KqlQuery kql() { + return TaggedUnionUtils.get(this, Kind.Kql); + } + /** * Is this variant instance of kind {@code match}? */ @@ -1569,6 +1588,16 @@ public ObjectBuilder knn(Function kql(KqlQuery v) { + this._kind = Kind.Kql; + this._value = v; + return this; + } + + public ObjectBuilder kql(Function> fn) { + return this.kql(fn.apply(new KqlQuery.Builder()).build()); + } + public ObjectBuilder match(MatchQuery v) { this._kind = Kind.Match; this._value = v; @@ -2038,6 +2067,7 @@ protected static void setupQueryDeserializer(ObjectDeserializer op) { op.add(Builder::ids, IdsQuery._DESERIALIZER, "ids"); op.add(Builder::intervals, IntervalsQuery._DESERIALIZER, "intervals"); op.add(Builder::knn, KnnQuery._DESERIALIZER, "knn"); + op.add(Builder::kql, KqlQuery._DESERIALIZER, "kql"); op.add(Builder::match, MatchQuery._DESERIALIZER, "match"); op.add(Builder::matchAll, MatchAllQuery._DESERIALIZER, "match_all"); op.add(Builder::matchBoolPrefix, MatchBoolPrefixQuery._DESERIALIZER, "match_bool_prefix"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBuilders.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBuilders.java index 3b1beb1511..7c4da70ca2 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBuilders.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBuilders.java @@ -389,6 +389,22 @@ public static Query knn(Function> fn) return builder.build(); } + /** + * Creates a builder for the {@link KqlQuery kql} {@code Query} variant. + */ + public static KqlQuery.Builder kql() { + return new KqlQuery.Builder(); + } + + /** + * Creates a Query of the {@link KqlQuery kql} {@code Query} variant. + */ + public static Query kql(Function> fn) { + Query.Builder builder = new Query.Builder(); + builder.kql(fn.apply(new KqlQuery.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link MatchQuery match} {@code Query} variant. */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html index 2673533a50..ba3bca8171 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html @@ -973,9 +973,9 @@ '_types.query_dsl.BoolQuery': '_types/query_dsl/compound.ts#L29-L56', '_types.query_dsl.BoostingQuery': '_types/query_dsl/compound.ts#L58-L74', '_types.query_dsl.ChildScoreMode': '_types/query_dsl/joining.ts#L25-L39', -'_types.query_dsl.CombinedFieldsOperator': '_types/query_dsl/abstractions.ts#L513-L516', -'_types.query_dsl.CombinedFieldsQuery': '_types/query_dsl/abstractions.ts#L466-L500', -'_types.query_dsl.CombinedFieldsZeroTerms': '_types/query_dsl/abstractions.ts#L518-L527', +'_types.query_dsl.CombinedFieldsOperator': '_types/query_dsl/abstractions.ts#L522-L525', +'_types.query_dsl.CombinedFieldsQuery': '_types/query_dsl/abstractions.ts#L475-L509', +'_types.query_dsl.CombinedFieldsZeroTerms': '_types/query_dsl/abstractions.ts#L527-L536', '_types.query_dsl.CommonTermsQuery': '_types/query_dsl/fulltext.ts#L34-L44', '_types.query_dsl.ConstantScoreQuery': '_types/query_dsl/compound.ts#L76-L86', '_types.query_dsl.DateDecayFunction': '_types/query_dsl/compound.ts#L211-L211', @@ -988,8 +988,8 @@ '_types.query_dsl.DistanceFeatureQuery': '_types/query_dsl/specialized.ts#L76-L85', '_types.query_dsl.DistanceFeatureQueryBase': '_types/query_dsl/specialized.ts#L39-L59', '_types.query_dsl.ExistsQuery': '_types/query_dsl/term.ts#L37-L45', -'_types.query_dsl.FieldAndFormat': '_types/query_dsl/abstractions.ts#L529-L543', -'_types.query_dsl.FieldLookup': '_types/query_dsl/abstractions.ts#L430-L447', +'_types.query_dsl.FieldAndFormat': '_types/query_dsl/abstractions.ts#L538-L552', +'_types.query_dsl.FieldLookup': '_types/query_dsl/abstractions.ts#L439-L456', '_types.query_dsl.FieldValueFactorModifier': '_types/query_dsl/compound.ts#L331-L374', '_types.query_dsl.FieldValueFactorScoreFunction': '_types/query_dsl/compound.ts#L151-L170', '_types.query_dsl.FunctionBoostMode': '_types/query_dsl/compound.ts#L303-L329', @@ -1022,6 +1022,7 @@ '_types.query_dsl.IntervalsRange': '_types/query_dsl/fulltext.ts#L237-L264', '_types.query_dsl.IntervalsRegexp': '_types/query_dsl/fulltext.ts#L266-L281', '_types.query_dsl.IntervalsWildcard': '_types/query_dsl/fulltext.ts#L319-L334', +'_types.query_dsl.KqlQuery': '_types/query_dsl/KqlQuery.ts#L24-L48', '_types.query_dsl.Like': '_types/query_dsl/specialized.ts#L198-L203', '_types.query_dsl.LikeDocument': '_types/query_dsl/specialized.ts#L174-L196', '_types.query_dsl.LongNumberRangeQuery': '_types/query_dsl/term.ts#L170-L170', @@ -1043,8 +1044,8 @@ '_types.query_dsl.PinnedDoc': '_types/query_dsl/specialized.ts#L269-L278', '_types.query_dsl.PinnedQuery': '_types/query_dsl/specialized.ts#L247-L267', '_types.query_dsl.PrefixQuery': '_types/query_dsl/term.ts#L98-L120', -'_types.query_dsl.QueryBase': '_types/query_dsl/abstractions.ts#L453-L464', -'_types.query_dsl.QueryContainer': '_types/query_dsl/abstractions.ts#L97-L428', +'_types.query_dsl.QueryBase': '_types/query_dsl/abstractions.ts#L462-L473', +'_types.query_dsl.QueryContainer': '_types/query_dsl/abstractions.ts#L98-L437', '_types.query_dsl.QueryStringQuery': '_types/query_dsl/fulltext.ts#L650-L773', '_types.query_dsl.RandomScoreFunction': '_types/query_dsl/compound.ts#L145-L149', '_types.query_dsl.RangeQuery': '_types/query_dsl/term.ts#L174-L185', @@ -1091,7 +1092,7 @@ '_types.query_dsl.UntypedRangeQuery': '_types/query_dsl/term.ts#L146-L155', '_types.query_dsl.WeightedTokensQuery': '_types/query_dsl/WeightedTokensQuery.ts#L25-L33', '_types.query_dsl.WildcardQuery': '_types/query_dsl/term.ts#L304-L324', -'_types.query_dsl.WrapperQuery': '_types/query_dsl/abstractions.ts#L502-L511', +'_types.query_dsl.WrapperQuery': '_types/query_dsl/abstractions.ts#L511-L520', '_types.query_dsl.ZeroTermsQuery': '_types/query_dsl/fulltext.ts#L639-L648', 'async_search._types.AsyncSearch': 'async_search/_types/AsyncSearch.ts#L30-L56', 'async_search._types.AsyncSearchDocumentResponseBase': 'async_search/_types/AsyncSearchResponseBase.ts#L54-L58', @@ -2389,8 +2390,8 @@ 'ml._types.CategorizationAnalyzerDefinition': 'ml/_types/Analysis.ts#L119-L133', 'ml._types.CategorizationStatus': 'ml/_types/Model.ts#L84-L87', 'ml._types.Category': 'ml/_types/Category.ts#L23-L49', -'ml._types.ChunkingConfig': 'ml/_types/Datafeed.ts#L255-L268', -'ml._types.ChunkingMode': 'ml/_types/Datafeed.ts#L249-L253', +'ml._types.ChunkingConfig': 'ml/_types/Datafeed.ts#L259-L272', +'ml._types.ChunkingMode': 'ml/_types/Datafeed.ts#L253-L257', 'ml._types.ClassificationInferenceOptions': 'ml/_types/inference.ts#L118-L133', 'ml._types.CommonTokenizationConfig': 'ml/_types/inference.ts#L160-L186', 'ml._types.ConditionOperator': 'ml/_types/Rule.ts#L74-L79', @@ -2398,11 +2399,11 @@ 'ml._types.DataDescription': 'ml/_types/Job.ts#L376-L392', 'ml._types.Datafeed': 'ml/_types/Datafeed.ts#L37-L64', 'ml._types.DatafeedAuthorization': 'ml/_types/Authorization.ts#L31-L44', -'ml._types.DatafeedConfig': 'ml/_types/Datafeed.ts#L66-L124', -'ml._types.DatafeedRunningState': 'ml/_types/Datafeed.ts#L214-L228', -'ml._types.DatafeedState': 'ml/_types/Datafeed.ts#L140-L145', -'ml._types.DatafeedStats': 'ml/_types/Datafeed.ts#L147-L176', -'ml._types.DatafeedTimingStats': 'ml/_types/Datafeed.ts#L178-L206', +'ml._types.DatafeedConfig': 'ml/_types/Datafeed.ts#L66-L128', +'ml._types.DatafeedRunningState': 'ml/_types/Datafeed.ts#L218-L232', +'ml._types.DatafeedState': 'ml/_types/Datafeed.ts#L144-L149', +'ml._types.DatafeedStats': 'ml/_types/Datafeed.ts#L151-L180', +'ml._types.DatafeedTimingStats': 'ml/_types/Datafeed.ts#L182-L210', 'ml._types.DataframeAnalysis': 'ml/_types/DataframeAnalytics.ts#L134-L213', 'ml._types.DataframeAnalysisAnalyzedFields': 'ml/_types/DataframeAnalytics.ts#L238-L244', 'ml._types.DataframeAnalysisClassification': 'ml/_types/DataframeAnalytics.ts#L227-L236', @@ -2440,7 +2441,7 @@ 'ml._types.DataframeEvaluationRegressionMetricsHuber': 'ml/_types/DataframeEvaluation.ts#L117-L120', 'ml._types.DataframeEvaluationRegressionMetricsMsle': 'ml/_types/DataframeEvaluation.ts#L112-L115', 'ml._types.DataframeState': 'ml/_types/Dataframe.ts#L20-L26', -'ml._types.DelayedDataCheckConfig': 'ml/_types/Datafeed.ts#L126-L137', +'ml._types.DelayedDataCheckConfig': 'ml/_types/Datafeed.ts#L130-L141', 'ml._types.DeploymentAllocationState': 'ml/_types/TrainedModel.ts#L334-L347', 'ml._types.DeploymentAssignmentState': 'ml/_types/TrainedModel.ts#L349-L366', 'ml._types.DetectionRule': 'ml/_types/Rule.ts#L25-L39', @@ -2450,7 +2451,7 @@ 'ml._types.DiscoveryNodeCompact': 'ml/_types/DiscoveryNode.ts#L39-L48', 'ml._types.DiscoveryNodeContent': 'ml/_types/DiscoveryNode.ts#L27-L37', 'ml._types.ExcludeFrequent': 'ml/_types/Detector.ts#L91-L96', -'ml._types.ExponentialAverageCalculationContext': 'ml/_types/Datafeed.ts#L208-L212', +'ml._types.ExponentialAverageCalculationContext': 'ml/_types/Datafeed.ts#L212-L216', 'ml._types.FillMaskInferenceOptions': 'ml/_types/inference.ts#L286-L303', 'ml._types.FillMaskInferenceUpdateOptions': 'ml/_types/inference.ts#L434-L441', 'ml._types.Filter': 'ml/_types/Filter.ts#L22-L29', @@ -2500,7 +2501,7 @@ 'ml._types.RoutingState': 'ml/_types/TrainedModel.ts#L411-L432', 'ml._types.RuleAction': 'ml/_types/Rule.ts#L41-L50', 'ml._types.RuleCondition': 'ml/_types/Rule.ts#L52-L65', -'ml._types.RunningStateSearchInterval': 'ml/_types/Datafeed.ts#L230-L247', +'ml._types.RunningStateSearchInterval': 'ml/_types/Datafeed.ts#L234-L251', 'ml._types.SnapshotUpgradeState': 'ml/_types/Model.ts#L95-L100', 'ml._types.TextClassificationInferenceOptions': 'ml/_types/inference.ts#L202-L214', 'ml._types.TextClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L386-L395', @@ -2664,8 +2665,8 @@ 'ml.put_calendar_job.Response': 'ml/put_calendar_job/MlPutCalendarJobResponse.ts#L22-L31', 'ml.put_data_frame_analytics.Request': 'ml/put_data_frame_analytics/MlPutDataFrameAnalyticsRequest.ts#L36-L164', 'ml.put_data_frame_analytics.Response': 'ml/put_data_frame_analytics/MlPutDataFrameAnalyticsResponse.ts#L31-L47', -'ml.put_datafeed.Request': 'ml/put_datafeed/MlPutDatafeedRequest.ts#L38-L194', -'ml.put_datafeed.Response': 'ml/put_datafeed/MlPutDatafeedResponse.ts#L31-L49', +'ml.put_datafeed.Request': 'ml/put_datafeed/MlPutDatafeedRequest.ts#L38-L202', +'ml.put_datafeed.Response': 'ml/put_datafeed/MlPutDatafeedResponse.ts#L31-L50', 'ml.put_filter.Request': 'ml/put_filter/MlPutFilterRequest.ts#L23-L61', 'ml.put_filter.Response': 'ml/put_filter/MlPutFilterResponse.ts#L22-L28', 'ml.put_job.Request': 'ml/put_job/MlPutJobRequest.ts#L30-L159', @@ -2710,8 +2711,8 @@ 'ml.stop_trained_model_deployment.Response': 'ml/stop_trained_model_deployment/MlStopTrainedModelDeploymentResponse.ts#L20-L22', 'ml.update_data_frame_analytics.Request': 'ml/update_data_frame_analytics/MlUpdateDataFrameAnalyticsRequest.ts#L24-L83', 'ml.update_data_frame_analytics.Response': 'ml/update_data_frame_analytics/MlUpdateDataFrameAnalyticsResponse.ts#L30-L45', -'ml.update_datafeed.Request': 'ml/update_datafeed/MlUpdateDatafeedRequest.ts#L31-L173', -'ml.update_datafeed.Response': 'ml/update_datafeed/MlUpdateDatafeedResponse.ts#L31-L52', +'ml.update_datafeed.Request': 'ml/update_datafeed/MlUpdateDatafeedRequest.ts#L31-L181', +'ml.update_datafeed.Response': 'ml/update_datafeed/MlUpdateDatafeedResponse.ts#L31-L53', 'ml.update_filter.Request': 'ml/update_filter/MlUpdateFilterRequest.ts#L23-L63', 'ml.update_filter.Response': 'ml/update_filter/MlUpdateFilterResponse.ts#L22-L28', 'ml.update_job.Request': 'ml/update_job/MlUpdateJobRequest.ts#L33-L150', @@ -3641,10 +3642,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/c4854e67b7a5072cc76e08dbec274c70a0a6d72d/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/84bf510a907bae62ffe29af35f516af287a79eab/specification/" + (paths[hash] || ""); - Please see the Elasticsearch API specification. + Please see the Elasticsearch API specification. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/DatafeedConfig.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/DatafeedConfig.java index da08f28f63..a6d1a58980 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/DatafeedConfig.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/DatafeedConfig.java @@ -95,6 +95,9 @@ public class DatafeedConfig implements JsonpSerializable { @Nullable private final Integer maxEmptySearches; + @Nullable + private final Integer maxConsecutiveExtractionFailures; + @Nullable private final Query query; @@ -121,6 +124,7 @@ private DatafeedConfig(Builder builder) { this.indicesOptions = builder.indicesOptions; this.jobId = builder.jobId; this.maxEmptySearches = builder.maxEmptySearches; + this.maxConsecutiveExtractionFailures = builder.maxConsecutiveExtractionFailures; this.query = builder.query; this.queryDelay = builder.queryDelay; this.runtimeMappings = ApiTypeHelper.unmodifiable(builder.runtimeMappings); @@ -248,6 +252,23 @@ public final Integer maxEmptySearches() { return this.maxEmptySearches; } + /** + * The maximum number of consecutive real-time data extraction failures the + * datafeed tolerates before it automatically stops itself, leaving the + * associated job open. The consecutive-failure counter resets on any cycle that + * extracts successfully, including empty-data cycles. If not set, the threshold + * defaults to roughly one day's worth of searches based on the datafeed + * frequency (floored at 1). Set to -1 to disable + * auto-stop and retry indefinitely. Values of 0 or less than + * -1 are rejected. + *

+ * API name: {@code max_consecutive_extraction_failures} + */ + @Nullable + public final Integer maxConsecutiveExtractionFailures() { + return this.maxConsecutiveExtractionFailures; + } + /** * The Elasticsearch query domain-specific language (DSL). This value * corresponds to the query object in an Elasticsearch search POST body. All the @@ -374,6 +395,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("max_empty_searches"); generator.write(this.maxEmptySearches); + } + if (this.maxConsecutiveExtractionFailures != null) { + generator.writeKey("max_consecutive_extraction_failures"); + generator.write(this.maxConsecutiveExtractionFailures); + } if (this.query != null) { generator.writeKey("query"); @@ -454,6 +480,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Integer maxEmptySearches; + @Nullable + private Integer maxConsecutiveExtractionFailures; + @Nullable private Query query; @@ -481,6 +510,7 @@ private Builder(DatafeedConfig instance) { this.indicesOptions = instance.indicesOptions; this.jobId = instance.jobId; this.maxEmptySearches = instance.maxEmptySearches; + this.maxConsecutiveExtractionFailures = instance.maxConsecutiveExtractionFailures; this.query = instance.query; this.queryDelay = instance.queryDelay; this.runtimeMappings = instance.runtimeMappings; @@ -715,6 +745,23 @@ public final Builder maxEmptySearches(@Nullable Integer value) { return this; } + /** + * The maximum number of consecutive real-time data extraction failures the + * datafeed tolerates before it automatically stops itself, leaving the + * associated job open. The consecutive-failure counter resets on any cycle that + * extracts successfully, including empty-data cycles. If not set, the threshold + * defaults to roughly one day's worth of searches based on the datafeed + * frequency (floored at 1). Set to -1 to disable + * auto-stop and retry indefinitely. Values of 0 or less than + * -1 are rejected. + *

+ * API name: {@code max_consecutive_extraction_failures} + */ + public final Builder maxConsecutiveExtractionFailures(@Nullable Integer value) { + this.maxConsecutiveExtractionFailures = value; + return this; + } + /** * The Elasticsearch query domain-specific language (DSL). This value * corresponds to the query object in an Elasticsearch search POST body. All the @@ -916,6 +963,8 @@ protected static void setupDatafeedConfigDeserializer(ObjectDeserializerfrequency (floored at 1). Set to -1 to disable + * auto-stop and retry indefinitely. Values of 0 or less than + * -1 are rejected. + *

+ * API name: {@code max_consecutive_extraction_failures} + */ + @Nullable + public final Integer maxConsecutiveExtractionFailures() { + return this.maxConsecutiveExtractionFailures; + } + /** * If a real-time datafeed has never seen any data (including during any initial * training period), it automatically stops and closes the associated job after @@ -482,6 +503,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("job_id"); generator.write(this.jobId); + } + if (this.maxConsecutiveExtractionFailures != null) { + generator.writeKey("max_consecutive_extraction_failures"); + generator.write(this.maxConsecutiveExtractionFailures); + } if (this.maxEmptySearches != null) { generator.writeKey("max_empty_searches"); @@ -575,6 +601,9 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private String jobId; + @Nullable + private Integer maxConsecutiveExtractionFailures; + @Nullable private Integer maxEmptySearches; @@ -609,6 +638,7 @@ private Builder(PutDatafeedRequest instance) { this.indices = instance.indices; this.indicesOptions = instance.indicesOptions; this.jobId = instance.jobId; + this.maxConsecutiveExtractionFailures = instance.maxConsecutiveExtractionFailures; this.maxEmptySearches = instance.maxEmptySearches; this.query = instance.query; this.queryDelay = instance.queryDelay; @@ -918,6 +948,23 @@ public final Builder jobId(@Nullable String value) { return this; } + /** + * The maximum number of consecutive real-time data extraction failures the + * datafeed tolerates before it automatically stops itself, leaving the + * associated job open. The consecutive-failure counter resets on any cycle that + * extracts successfully, including empty-data cycles. If not set, the threshold + * defaults to roughly one day's worth of searches based on the datafeed + * frequency (floored at 1). Set to -1 to disable + * auto-stop and retry indefinitely. Values of 0 or less than + * -1 are rejected. + *

+ * API name: {@code max_consecutive_extraction_failures} + */ + public final Builder maxConsecutiveExtractionFailures(@Nullable Integer value) { + this.maxConsecutiveExtractionFailures = value; + return this; + } + /** * If a real-time datafeed has never seen any data (including during any initial * training period), it automatically stops and closes the associated job after @@ -1135,6 +1182,8 @@ protected static void setupPutDatafeedRequestDeserializer(ObjectDeserializer @Nullable private Integer maxEmptySearches; + @Nullable + private Integer maxConsecutiveExtractionFailures; + private Query query; private Time queryDelay; @@ -552,6 +572,14 @@ public final Builder maxEmptySearches(@Nullable Integer value) { return this; } + /** + * API name: {@code max_consecutive_extraction_failures} + */ + public final Builder maxConsecutiveExtractionFailures(@Nullable Integer value) { + this.maxConsecutiveExtractionFailures = value; + return this; + } + /** * Required - API name: {@code query} */ @@ -697,6 +725,8 @@ protected static void setupPutDatafeedResponseDeserializer(ObjectDeserializerfrequency (floored at 1). Set to -1 to disable + * auto-stop and retry indefinitely. Values of 0 or less than + * -1 are rejected. + *

+ * API name: {@code max_consecutive_extraction_failures} + */ + @Nullable + public final Integer maxConsecutiveExtractionFailures() { + return this.maxConsecutiveExtractionFailures; + } + /** * If a real-time datafeed has never seen any data (including during any initial * training period), it automatically stops and closes the associated job after @@ -447,6 +468,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("job_id"); generator.write(this.jobId); + } + if (this.maxConsecutiveExtractionFailures != null) { + generator.writeKey("max_consecutive_extraction_failures"); + generator.write(this.maxConsecutiveExtractionFailures); + } if (this.maxEmptySearches != null) { generator.writeKey("max_empty_searches"); @@ -537,6 +563,9 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private String jobId; + @Nullable + private Integer maxConsecutiveExtractionFailures; + @Nullable private Integer maxEmptySearches; @@ -570,6 +599,7 @@ private Builder(UpdateDatafeedRequest instance) { this.indices = instance.indices; this.indicesOptions = instance.indicesOptions; this.jobId = instance.jobId; + this.maxConsecutiveExtractionFailures = instance.maxConsecutiveExtractionFailures; this.maxEmptySearches = instance.maxEmptySearches; this.query = instance.query; this.queryDelay = instance.queryDelay; @@ -856,6 +886,23 @@ public final Builder jobId(@Nullable String value) { return this; } + /** + * The maximum number of consecutive real-time data extraction failures the + * datafeed tolerates before it automatically stops itself, leaving the + * associated job open. The consecutive-failure counter resets on any cycle that + * extracts successfully, including empty-data cycles. If not set, the threshold + * defaults to roughly one day's worth of searches based on the datafeed + * frequency (floored at 1). Set to -1 to disable + * auto-stop and retry indefinitely. Values of 0 or less than + * -1 are rejected. + *

+ * API name: {@code max_consecutive_extraction_failures} + */ + public final Builder maxConsecutiveExtractionFailures(@Nullable Integer value) { + this.maxConsecutiveExtractionFailures = value; + return this; + } + /** * If a real-time datafeed has never seen any data (including during any initial * training period), it automatically stops and closes the associated job after @@ -1086,6 +1133,8 @@ protected static void setupUpdateDatafeedRequestDeserializer(ObjectDeserializer< "indexes"); op.add(Builder::indicesOptions, IndicesOptions._DESERIALIZER, "indices_options"); op.add(Builder::jobId, JsonpDeserializer.stringDeserializer(), "job_id"); + op.add(Builder::maxConsecutiveExtractionFailures, JsonpDeserializer.integerDeserializer(), + "max_consecutive_extraction_failures"); op.add(Builder::maxEmptySearches, JsonpDeserializer.integerDeserializer(), "max_empty_searches"); op.add(Builder::query, Query._DESERIALIZER, "query"); op.add(Builder::queryDelay, Time._DESERIALIZER, "query_delay"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateDatafeedResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateDatafeedResponse.java index db45fd2556..db0a1bd57a 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateDatafeedResponse.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateDatafeedResponse.java @@ -95,6 +95,9 @@ public class UpdateDatafeedResponse implements JsonpSerializable { @Nullable private final Integer maxEmptySearches; + @Nullable + private final Integer maxConsecutiveExtractionFailures; + private final Query query; private final Time queryDelay; @@ -119,6 +122,7 @@ private UpdateDatafeedResponse(Builder builder) { this.indicesOptions = builder.indicesOptions; this.jobId = ApiTypeHelper.requireNonNull(builder.jobId, this, "jobId"); this.maxEmptySearches = builder.maxEmptySearches; + this.maxConsecutiveExtractionFailures = builder.maxConsecutiveExtractionFailures; this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query"); this.queryDelay = ApiTypeHelper.requireNonNull(builder.queryDelay, this, "queryDelay"); this.runtimeMappings = ApiTypeHelper.unmodifiable(builder.runtimeMappings); @@ -215,6 +219,14 @@ public final Integer maxEmptySearches() { return this.maxEmptySearches; } + /** + * API name: {@code max_consecutive_extraction_failures} + */ + @Nullable + public final Integer maxConsecutiveExtractionFailures() { + return this.maxConsecutiveExtractionFailures; + } + /** * Required - API name: {@code query} */ @@ -315,6 +327,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("max_empty_searches"); generator.write(this.maxEmptySearches); + } + if (this.maxConsecutiveExtractionFailures != null) { + generator.writeKey("max_consecutive_extraction_failures"); + generator.write(this.maxConsecutiveExtractionFailures); + } generator.writeKey("query"); this.query.serialize(generator, mapper); @@ -389,6 +406,9 @@ public static class Builder extends WithJsonObjectBuilderBase @Nullable private Integer maxEmptySearches; + @Nullable + private Integer maxConsecutiveExtractionFailures; + private Query query; private Time queryDelay; @@ -579,6 +599,14 @@ public final Builder maxEmptySearches(@Nullable Integer value) { return this; } + /** + * API name: {@code max_consecutive_extraction_failures} + */ + public final Builder maxConsecutiveExtractionFailures(@Nullable Integer value) { + this.maxConsecutiveExtractionFailures = value; + return this; + } + /** * Required - API name: {@code query} */ @@ -725,6 +753,8 @@ protected static void setupUpdateDatafeedResponseDeserializer( op.add(Builder::indicesOptions, IndicesOptions._DESERIALIZER, "indices_options"); op.add(Builder::jobId, JsonpDeserializer.stringDeserializer(), "job_id"); op.add(Builder::maxEmptySearches, JsonpDeserializer.integerDeserializer(), "max_empty_searches"); + op.add(Builder::maxConsecutiveExtractionFailures, JsonpDeserializer.integerDeserializer(), + "max_consecutive_extraction_failures"); op.add(Builder::query, Query._DESERIALIZER, "query"); op.add(Builder::queryDelay, Time._DESERIALIZER, "query_delay"); op.add(Builder::runtimeMappings, JsonpDeserializer.stringMapDeserializer(RuntimeField._DESERIALIZER),