diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnSearch.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnSearch.java index 468ef24ce2..ee19acb32e 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnSearch.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnSearch.java @@ -92,6 +92,9 @@ public class KnnSearch implements JsonpSerializable { @Nullable private final RescoreVector rescoreVector; + @Nullable + private final String queryName; + // --------------------------------------------------------------------------------------------- private KnnSearch(Builder builder) { @@ -106,6 +109,7 @@ private KnnSearch(Builder builder) { this.similarity = builder.similarity; this.innerHits = builder.innerHits; this.rescoreVector = builder.rescoreVector; + this.queryName = builder.queryName; } @@ -211,6 +215,14 @@ public final RescoreVector rescoreVector() { return this.rescoreVector; } + /** + * API name: {@code _name} + */ + @Nullable + public final String queryName() { + return this.queryName; + } + /** * Serialize this object to JSON. */ @@ -280,6 +292,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { this.rescoreVector.serialize(generator, mapper); } + if (this.queryName != null) { + generator.writeKey("_name"); + generator.write(this.queryName); + + } } @@ -324,6 +341,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private RescoreVector rescoreVector; + @Nullable + private String queryName; + public Builder() { } private Builder(KnnSearch instance) { @@ -337,6 +357,7 @@ private Builder(KnnSearch instance) { this.similarity = instance.similarity; this.innerHits = instance.innerHits; this.rescoreVector = instance.rescoreVector; + this.queryName = instance.queryName; } /** @@ -534,6 +555,14 @@ public final Builder rescoreVector(FunctionAPI specification */ @JsonpDeserializable -public class Script implements IntervalsFilterVariant, JsonpSerializable { +public class Script implements IntervalsFilterVariant, MultiTermLookupVariant, JsonpSerializable { @Nullable private final String source; @@ -99,6 +101,14 @@ public IntervalsFilter.Kind _intervalsFilterKind() { return IntervalsFilter.Kind.Script; } + /** + * MultiTermLookup variant kind. + */ + @Override + public MultiTermLookup.Kind _multiTermLookupKind() { + return MultiTermLookup.Kind.Script; + } + /** * The script source. *

diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermLookup.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermLookup.java index 679b4f3f84..d7fbb211d0 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermLookup.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermLookup.java @@ -20,6 +20,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; import co.elastic.clients.elasticsearch._types.FieldValue; +import co.elastic.clients.elasticsearch._types.Script; +import co.elastic.clients.json.JsonEnum; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -29,8 +31,11 @@ import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; +import java.lang.Object; import java.lang.String; import java.util.Objects; import java.util.function.Function; @@ -60,17 +65,65 @@ * specification */ @JsonpDeserializable -public class MultiTermLookup implements JsonpSerializable { - private final String field; +public class MultiTermLookup implements TaggedUnion, JsonpSerializable { + + /** + * {@link MultiTermLookup} variant kinds. + * + * @see API + * specification + */ + + public enum Kind implements JsonEnum { + Field("field"), + + Script("script"), + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } @Nullable private final FieldValue missing; - // --------------------------------------------------------------------------------------------- + public MultiTermLookup(MultiTermLookupVariant value) { + + this._kind = ApiTypeHelper.requireNonNull(value._multiTermLookupKind(), this, ""); + this._value = ApiTypeHelper.requireNonNull(value, this, ""); + + this.missing = null; + + } private MultiTermLookup(Builder builder) { - this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + this.missing = builder.missing; } @@ -79,15 +132,6 @@ public static MultiTermLookup of(Function - * API name: {@code field} - */ - public final String field() { - return this.field; - } - /** * The value to apply to documents that do not have a value. By default, * documents without a value are ignored. @@ -100,18 +144,44 @@ public final FieldValue missing() { } /** - * Serialize this object to JSON. + * Is this variant instance of kind {@code field}? */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); + public boolean isField() { + return _kind == Kind.Field; } - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + /** + * Get the {@code field} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code field} kind. + */ + public String field() { + return TaggedUnionUtils.get(this, Kind.Field); + } - generator.writeKey("field"); - generator.write(this.field); + /** + * Is this variant instance of kind {@code script}? + */ + public boolean isScript() { + return _kind == Kind.Script; + } + + /** + * Get the {@code script} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code script} kind. + */ + public Script script() { + return TaggedUnionUtils.get(this, Kind.Script); + } + + @Override + @SuppressWarnings("unchecked") + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeStartObject(); if (this.missing != null) { generator.writeKey("missing"); @@ -119,6 +189,20 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + generator.writeKey(_kind.jsonValue()); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } else { + switch (_kind) { + case Field : + generator.write(((String) this._value)); + + break; + } + } + + generator.writeEnd(); + } @Override @@ -126,35 +210,13 @@ public String toString() { return JsonpUtils.toString(this); } - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link MultiTermLookup}. - */ - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String field; + private Kind _kind; + private Object _value; @Nullable private FieldValue missing; - public Builder() { - } - private Builder(MultiTermLookup instance) { - this.field = instance.field; - this.missing = instance.missing; - - } - /** - * Required - A fields from which to retrieve terms. - *

- * API name: {@code field} - */ - public final Builder field(String value) { - this.field = value; - return this; - } - /** * The value to apply to documents that do not have a value. By default, * documents without a value are ignored. @@ -224,39 +286,108 @@ public final Builder missing(boolean value) { protected Builder self() { return this; } + public ContainerBuilder field(String v) { + this._kind = Kind.Field; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder script(Script v) { + this._kind = Kind.Script; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder script(Function> fn) { + return this.script(fn.apply(new Script.Builder()).build()); + } - /** - * Builds a {@link MultiTermLookup}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ public MultiTermLookup build() { _checkSingleUse(); - return new MultiTermLookup(this); } - } - /** - * @return New {@link Builder} initialized with field values of this instance - */ - public Builder rebuild() { - return new Builder(this); + public class ContainerBuilder implements ObjectBuilder { + + /** + * The value to apply to documents that do not have a value. By default, + * documents without a value are ignored. + *

+ * API name: {@code missing} + */ + public final ContainerBuilder missing(@Nullable FieldValue value) { + Builder.this.missing = value; + return this; + } + + /** + * The value to apply to documents that do not have a value. By default, + * documents without a value are ignored. + *

+ * API name: {@code missing} + */ + public final ContainerBuilder missing(Function> fn) { + return this.missing(fn.apply(new FieldValue.Builder()).build()); + } + + /** + * The value to apply to documents that do not have a value. By default, + * documents without a value are ignored. + *

+ * API name: {@code missing} + */ + public final ContainerBuilder missing(String value) { + Builder.this.missing = FieldValue.of(value); + return this; + } + + /** + * The value to apply to documents that do not have a value. By default, + * documents without a value are ignored. + *

+ * API name: {@code missing} + */ + public final ContainerBuilder missing(long value) { + Builder.this.missing = FieldValue.of(value); + return this; + } + + /** + * The value to apply to documents that do not have a value. By default, + * documents without a value are ignored. + *

+ * API name: {@code missing} + */ + public final ContainerBuilder missing(double value) { + Builder.this.missing = FieldValue.of(value); + return this; + } + + /** + * The value to apply to documents that do not have a value. By default, + * documents without a value are ignored. + *

+ * API name: {@code missing} + */ + public final ContainerBuilder missing(boolean value) { + Builder.this.missing = FieldValue.of(value); + return this; + } + + public MultiTermLookup build() { + return Builder.this.build(); + } + } } - // --------------------------------------------------------------------------------------------- - /** - * Json deserializer for {@link MultiTermLookup} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - MultiTermLookup::setupMultiTermLookupDeserializer); - - protected static void setupMultiTermLookupDeserializer(ObjectDeserializer op) { + protected static void setupMultiTermLookupDeserializer(ObjectDeserializer op) { op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); + op.add(Builder::script, Script._DESERIALIZER, "script"); op.add(Builder::missing, FieldValue._DESERIALIZER, "missing"); } + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + MultiTermLookup::setupMultiTermLookupDeserializer, Builder::build); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermLookupBuilders.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermLookupBuilders.java new file mode 100644 index 0000000000..068d348a33 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermLookupBuilders.java @@ -0,0 +1,70 @@ +/* + * 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.aggregations; + +import co.elastic.clients.elasticsearch._types.Script; +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +//---------------------------------------------------------------- +// 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. +// +//---------------------------------------------------------------- + +/** + * Builders for {@link MultiTermLookup} variants. + *

+ * Variants field are not available here as they don't have a + * dedicated class. Use {@link MultiTermLookup}'s builder for these. + * + */ +public class MultiTermLookupBuilders { + private MultiTermLookupBuilders() { + } + + /** + * Creates a builder for the {@link Script script} {@code MultiTermLookup} + * variant. + */ + public static Script.Builder script() { + return new Script.Builder(); + } + + /** + * Creates a MultiTermLookup of the {@link Script script} + * {@code MultiTermLookup} variant. + */ + public static MultiTermLookup script(Function> fn) { + MultiTermLookup.Builder builder = new MultiTermLookup.Builder(); + builder.script(fn.apply(new Script.Builder()).build()); + return builder.build(); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermLookupVariant.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermLookupVariant.java new file mode 100644 index 0000000000..bc083f167e --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermLookupVariant.java @@ -0,0 +1,48 @@ +/* + * 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.aggregations; + +//---------------------------------------------------------------- +// 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. +// +//---------------------------------------------------------------- + +/** + * Base interface for {@link MultiTermLookup} variants. + */ +public interface MultiTermLookupVariant { + + MultiTermLookup.Kind _multiTermLookupKind(); + + default MultiTermLookup _toMultiTermLookup() { + return new MultiTermLookup(this); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregation.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregation.java index 8638ec614c..8f366652a7 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregation.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregation.java @@ -425,6 +425,21 @@ public final Builder terms(MultiTermLookup value, MultiTermLookup... values) { return this; } + /** + * Required - The field from which to generate sets of terms. + *

+ * API name: {@code terms} + *

+ * Adds one or more values to terms. + */ + public final Builder terms(MultiTermLookupVariant value, MultiTermLookupVariant... values) { + this.terms = _listAdd(this.terms, value._toMultiTermLookup()); + for (MultiTermLookupVariant v : values) { + _listAdd(this.terms, v._toMultiTermLookup()); + } + return this; + } + /** * Required - The field from which to generate sets of terms. *

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 9faf9d66af..3f569a3835 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 @@ -304,9 +304,9 @@ '_types.IndicesResponseBase': '_types/Base.ts#L146-L148', '_types.InlineGet': '_types/common.ts#L335-L348', '_types.InnerRetriever': '_types/Retriever.ts#L85-L89', -'_types.KnnQuery': '_types/Knn.ts#L64-L87', +'_types.KnnQuery': '_types/Knn.ts#L66-L89', '_types.KnnRetriever': '_types/Retriever.ts#L115-L133', -'_types.KnnSearch': '_types/Knn.ts#L35-L62', +'_types.KnnSearch': '_types/Knn.ts#L35-L64', '_types.LatLonGeoLocation': '_types/Geo.ts#L114-L123', '_types.Level': '_types/common.ts#L264-L268', '_types.LifecycleOperationMode': '_types/Lifecycle.ts#L20-L24', @@ -322,7 +322,7 @@ '_types.PinnedRetriever': '_types/Retriever.ts#L77-L83', '_types.PluginStats': '_types/Stats.ts#L205-L215', '_types.QueryCacheStats': '_types/Stats.ts#L217-L251', -'_types.QueryVectorBuilder': '_types/Knn.ts#L89-L92', +'_types.QueryVectorBuilder': '_types/Knn.ts#L91-L94', '_types.RRFRetriever': '_types/Retriever.ts#L135-L144', '_types.RankBase': '_types/Rank.ts#L30-L30', '_types.RankContainer': '_types/Rank.ts#L22-L28', @@ -367,7 +367,7 @@ '_types.StoredScript': '_types/Scripting.ts#L47-L59', '_types.SuggestMode': '_types/common.ts#L297-L310', '_types.TaskFailure': '_types/Errors.ts#L71-L76', -'_types.TextEmbedding': '_types/Knn.ts#L94-L103', +'_types.TextEmbedding': '_types/Knn.ts#L96-L105', '_types.TextSimilarityReranker': '_types/Retriever.ts#L146-L157', '_types.ThreadType': '_types/common.ts#L312-L318', '_types.TimeUnit': '_types/Time.ts#L70-L78', @@ -391,7 +391,7 @@ '_types.aggregations.AggregateBase': '_types/aggregations/Aggregate.ts#L141-L143', '_types.aggregations.Aggregation': '_types/aggregations/Aggregation.ts#L20-L20', '_types.aggregations.AggregationContainer': '_types/aggregations/AggregationContainer.ts#L110-L556', -'_types.aggregations.AggregationRange': '_types/aggregations/bucket.ts#L691-L704', +'_types.aggregations.AggregationRange': '_types/aggregations/bucket.ts#L701-L714', '_types.aggregations.ArrayPercentilesItem': '_types/aggregations/Aggregate.ts#L167-L171', '_types.aggregations.AutoDateHistogramAggregate': '_types/aggregations/Aggregate.ts#L464-L471', '_types.aggregations.AutoDateHistogramAggregation': '_types/aggregations/bucket.ts#L72-L110', @@ -421,13 +421,13 @@ '_types.aggregations.CartesianBoundsAggregation': '_types/aggregations/metric.ts#L114-L114', '_types.aggregations.CartesianCentroidAggregate': '_types/aggregations/Aggregate.ts#L335-L339', '_types.aggregations.CartesianCentroidAggregation': '_types/aggregations/metric.ts#L116-L116', -'_types.aggregations.CategorizeTextAggregation': '_types/aggregations/bucket.ts#L1143-L1209', -'_types.aggregations.CategorizeTextAnalyzer': '_types/aggregations/bucket.ts#L1211-L1214', +'_types.aggregations.CategorizeTextAggregation': '_types/aggregations/bucket.ts#L1153-L1219', +'_types.aggregations.CategorizeTextAnalyzer': '_types/aggregations/bucket.ts#L1221-L1224', '_types.aggregations.ChangePointAggregate': '_types/aggregations/Aggregate.ts#L388-L392', '_types.aggregations.ChangePointAggregation': '_types/aggregations/pipeline.ts#L206-L206', '_types.aggregations.ChangePointBucket': '_types/aggregations/Aggregate.ts#L394-L396', '_types.aggregations.ChangeType': '_types/aggregations/Aggregate.ts#L398-L410', -'_types.aggregations.ChiSquareHeuristic': '_types/aggregations/bucket.ts#L782-L791', +'_types.aggregations.ChiSquareHeuristic': '_types/aggregations/bucket.ts#L792-L801', '_types.aggregations.ChildrenAggregate': '_types/aggregations/Aggregate.ts#L961-L965', '_types.aggregations.ChildrenAggregation': '_types/aggregations/bucket.ts#L121-L126', '_types.aggregations.CompositeAggregate': '_types/aggregations/Aggregate.ts#L771-L776', @@ -442,7 +442,7 @@ '_types.aggregations.CumulativeCardinalityAggregate': '_types/aggregations/Aggregate.ts#L929-L937', '_types.aggregations.CumulativeCardinalityAggregation': '_types/aggregations/pipeline.ts#L208-L211', '_types.aggregations.CumulativeSumAggregation': '_types/aggregations/pipeline.ts#L213-L216', -'_types.aggregations.CustomCategorizeTextAnalyzer': '_types/aggregations/bucket.ts#L1216-L1220', +'_types.aggregations.CustomCategorizeTextAnalyzer': '_types/aggregations/bucket.ts#L1226-L1230', '_types.aggregations.DateHistogramAggregate': '_types/aggregations/Aggregate.ts#L454-L457', '_types.aggregations.DateHistogramAggregation': '_types/aggregations/bucket.ts#L202-L260', '_types.aggregations.DateHistogramBucket': '_types/aggregations/Aggregate.ts#L459-L462', @@ -471,9 +471,9 @@ '_types.aggregations.FormatMetricAggregationBase': '_types/aggregations/metric.ts#L47-L49', '_types.aggregations.FormattableMetricAggregation': '_types/aggregations/metric.ts#L51-L53', '_types.aggregations.FrequentItemSetsAggregate': '_types/aggregations/Aggregate.ts#L795-L796', -'_types.aggregations.FrequentItemSetsAggregation': '_types/aggregations/bucket.ts#L1267-L1294', +'_types.aggregations.FrequentItemSetsAggregation': '_types/aggregations/bucket.ts#L1277-L1304', '_types.aggregations.FrequentItemSetsBucket': '_types/aggregations/Aggregate.ts#L798-L801', -'_types.aggregations.FrequentItemSetsField': '_types/aggregations/bucket.ts#L1253-L1265', +'_types.aggregations.FrequentItemSetsField': '_types/aggregations/bucket.ts#L1263-L1275', '_types.aggregations.GapPolicy': '_types/aggregations/pipeline.ts#L61-L76', '_types.aggregations.GeoBoundsAggregate': '_types/aggregations/Aggregate.ts#L343-L349', '_types.aggregations.GeoBoundsAggregation': '_types/aggregations/metric.ts#L118-L127', @@ -496,7 +496,7 @@ '_types.aggregations.GeohexGridAggregation': '_types/aggregations/bucket.ts#L479-L504', '_types.aggregations.GlobalAggregate': '_types/aggregations/Aggregate.ts#L617-L621', '_types.aggregations.GlobalAggregation': '_types/aggregations/bucket.ts#L506-L506', -'_types.aggregations.GoogleNormalizedDistanceHeuristic': '_types/aggregations/bucket.ts#L793-L798', +'_types.aggregations.GoogleNormalizedDistanceHeuristic': '_types/aggregations/bucket.ts#L803-L808', '_types.aggregations.HdrMethod': '_types/aggregations/metric.ts#L241-L246', '_types.aggregations.HdrPercentileRanksAggregate': '_types/aggregations/Aggregate.ts#L176-L177', '_types.aggregations.HdrPercentilesAggregate': '_types/aggregations/Aggregate.ts#L173-L174', @@ -516,7 +516,7 @@ '_types.aggregations.InferenceFeatureImportance': '_types/aggregations/Aggregate.ts#L851-L855', '_types.aggregations.InferenceTopClassEntry': '_types/aggregations/Aggregate.ts#L845-L849', '_types.aggregations.IpPrefixAggregate': '_types/aggregations/Aggregate.ts#L782-L786', -'_types.aggregations.IpPrefixAggregation': '_types/aggregations/bucket.ts#L1222-L1251', +'_types.aggregations.IpPrefixAggregation': '_types/aggregations/bucket.ts#L1232-L1261', '_types.aggregations.IpPrefixBucket': '_types/aggregations/Aggregate.ts#L788-L793', '_types.aggregations.IpRangeAggregate': '_types/aggregations/Aggregate.ts#L695-L700', '_types.aggregations.IpRangeAggregation': '_types/aggregations/bucket.ts#L567-L576', @@ -550,20 +550,20 @@ '_types.aggregations.MovingPercentilesAggregation': '_types/aggregations/pipeline.ts#L336-L351', '_types.aggregations.MultiBucketAggregateBase': '_types/aggregations/Aggregate.ts#L373-L375', '_types.aggregations.MultiBucketBase': '_types/aggregations/Aggregate.ts#L377-L386', -'_types.aggregations.MultiTermLookup': '_types/aggregations/bucket.ts#L643-L653', +'_types.aggregations.MultiTermLookup': '_types/aggregations/bucket.ts#L643-L663', '_types.aggregations.MultiTermsAggregate': '_types/aggregations/Aggregate.ts#L572-L577', '_types.aggregations.MultiTermsAggregation': '_types/aggregations/bucket.ts#L601-L641', '_types.aggregations.MultiTermsBucket': '_types/aggregations/Aggregate.ts#L579-L583', -'_types.aggregations.MutualInformationHeuristic': '_types/aggregations/bucket.ts#L800-L809', +'_types.aggregations.MutualInformationHeuristic': '_types/aggregations/bucket.ts#L810-L819', '_types.aggregations.NestedAggregate': '_types/aggregations/Aggregate.ts#L605-L609', -'_types.aggregations.NestedAggregation': '_types/aggregations/bucket.ts#L655-L660', +'_types.aggregations.NestedAggregation': '_types/aggregations/bucket.ts#L665-L670', '_types.aggregations.NonStationary': '_types/aggregations/Aggregate.ts#L429-L433', '_types.aggregations.NormalizeAggregation': '_types/aggregations/pipeline.ts#L353-L361', '_types.aggregations.NormalizeMethod': '_types/aggregations/pipeline.ts#L363-L389', -'_types.aggregations.PValueHeuristic': '_types/aggregations/bucket.ts#L817-L831', +'_types.aggregations.PValueHeuristic': '_types/aggregations/bucket.ts#L827-L841', '_types.aggregations.ParentAggregate': '_types/aggregations/Aggregate.ts#L967-L971', -'_types.aggregations.ParentAggregation': '_types/aggregations/bucket.ts#L662-L667', -'_types.aggregations.PercentageScoreHeuristic': '_types/aggregations/bucket.ts#L811-L811', +'_types.aggregations.ParentAggregation': '_types/aggregations/bucket.ts#L672-L677', +'_types.aggregations.PercentageScoreHeuristic': '_types/aggregations/bucket.ts#L821-L821', '_types.aggregations.PercentileRanksAggregation': '_types/aggregations/metric.ts#L196-L218', '_types.aggregations.Percentiles': '_types/aggregations/Aggregate.ts#L157-L158', '_types.aggregations.PercentilesAggregateBase': '_types/aggregations/Aggregate.ts#L153-L155', @@ -571,20 +571,20 @@ '_types.aggregations.PercentilesBucketAggregate': '_types/aggregations/Aggregate.ts#L185-L186', '_types.aggregations.PercentilesBucketAggregation': '_types/aggregations/pipeline.ts#L391-L399', '_types.aggregations.PipelineAggregationBase': '_types/aggregations/pipeline.ts#L39-L51', -'_types.aggregations.RandomSamplerAggregation': '_types/aggregations/bucket.ts#L749-L769', +'_types.aggregations.RandomSamplerAggregation': '_types/aggregations/bucket.ts#L759-L779', '_types.aggregations.RangeAggregate': '_types/aggregations/Aggregate.ts#L665-L669', -'_types.aggregations.RangeAggregation': '_types/aggregations/bucket.ts#L669-L689', +'_types.aggregations.RangeAggregation': '_types/aggregations/bucket.ts#L679-L699', '_types.aggregations.RangeBucket': '_types/aggregations/Aggregate.ts#L671-L678', -'_types.aggregations.RareTermsAggregation': '_types/aggregations/bucket.ts#L706-L739', +'_types.aggregations.RareTermsAggregation': '_types/aggregations/bucket.ts#L716-L749', '_types.aggregations.RateAggregate': '_types/aggregations/Aggregate.ts#L920-L927', '_types.aggregations.RateAggregation': '_types/aggregations/metric.ts#L266-L277', '_types.aggregations.RateMode': '_types/aggregations/metric.ts#L279-L288', '_types.aggregations.ReverseNestedAggregate': '_types/aggregations/Aggregate.ts#L611-L615', -'_types.aggregations.ReverseNestedAggregation': '_types/aggregations/bucket.ts#L741-L747', +'_types.aggregations.ReverseNestedAggregation': '_types/aggregations/bucket.ts#L751-L757', '_types.aggregations.SamplerAggregate': '_types/aggregations/Aggregate.ts#L629-L630', -'_types.aggregations.SamplerAggregation': '_types/aggregations/bucket.ts#L771-L780', +'_types.aggregations.SamplerAggregation': '_types/aggregations/bucket.ts#L781-L790', '_types.aggregations.SamplerAggregationExecutionHint': '_types/aggregations/bucket.ts#L359-L372', -'_types.aggregations.ScriptedHeuristic': '_types/aggregations/bucket.ts#L813-L815', +'_types.aggregations.ScriptedHeuristic': '_types/aggregations/bucket.ts#L823-L825', '_types.aggregations.ScriptedMetricAggregate': '_types/aggregations/Aggregate.ts#L812-L818', '_types.aggregations.ScriptedMetricAggregation': '_types/aggregations/metric.ts#L290-L316', '_types.aggregations.SerialDifferencingAggregation': '_types/aggregations/pipeline.ts#L401-L410', @@ -593,9 +593,9 @@ '_types.aggregations.SignificantStringTermsAggregate': '_types/aggregations/Aggregate.ts#L755-L757', '_types.aggregations.SignificantStringTermsBucket': '_types/aggregations/Aggregate.ts#L759-L761', '_types.aggregations.SignificantTermsAggregateBase': '_types/aggregations/Aggregate.ts#L731-L739', -'_types.aggregations.SignificantTermsAggregation': '_types/aggregations/bucket.ts#L833-L910', +'_types.aggregations.SignificantTermsAggregation': '_types/aggregations/bucket.ts#L843-L920', '_types.aggregations.SignificantTermsBucketBase': '_types/aggregations/Aggregate.ts#L745-L748', -'_types.aggregations.SignificantTextAggregation': '_types/aggregations/bucket.ts#L912-L987', +'_types.aggregations.SignificantTextAggregation': '_types/aggregations/bucket.ts#L922-L997', '_types.aggregations.SimpleMovingAverageAggregation': '_types/aggregations/pipeline.ts#L275-L278', '_types.aggregations.SimpleValueAggregate': '_types/aggregations/Aggregate.ts#L243-L244', '_types.aggregations.SingleBucketAggregateBase': '_types/aggregations/Aggregate.ts#L587-L597', @@ -626,16 +626,16 @@ '_types.aggregations.TTestAggregation': '_types/aggregations/metric.ts#L330-L344', '_types.aggregations.TTestType': '_types/aggregations/metric.ts#L358-L371', '_types.aggregations.TermsAggregateBase': '_types/aggregations/Aggregate.ts#L488-L493', -'_types.aggregations.TermsAggregation': '_types/aggregations/bucket.ts#L989-L1057', -'_types.aggregations.TermsAggregationCollectMode': '_types/aggregations/bucket.ts#L1082-L1091', -'_types.aggregations.TermsAggregationExecutionHint': '_types/aggregations/bucket.ts#L1093-L1098', +'_types.aggregations.TermsAggregation': '_types/aggregations/bucket.ts#L999-L1067', +'_types.aggregations.TermsAggregationCollectMode': '_types/aggregations/bucket.ts#L1092-L1101', +'_types.aggregations.TermsAggregationExecutionHint': '_types/aggregations/bucket.ts#L1103-L1108', '_types.aggregations.TermsBucketBase': '_types/aggregations/Aggregate.ts#L502-L504', -'_types.aggregations.TermsExclude': '_types/aggregations/bucket.ts#L1103-L1104', -'_types.aggregations.TermsInclude': '_types/aggregations/bucket.ts#L1100-L1101', -'_types.aggregations.TermsPartition': '_types/aggregations/bucket.ts#L1106-L1115', +'_types.aggregations.TermsExclude': '_types/aggregations/bucket.ts#L1113-L1114', +'_types.aggregations.TermsInclude': '_types/aggregations/bucket.ts#L1110-L1111', +'_types.aggregations.TermsPartition': '_types/aggregations/bucket.ts#L1116-L1125', '_types.aggregations.TestPopulation': '_types/aggregations/metric.ts#L346-L356', '_types.aggregations.TimeSeriesAggregate': '_types/aggregations/Aggregate.ts#L803-L804', -'_types.aggregations.TimeSeriesAggregation': '_types/aggregations/bucket.ts#L1059-L1072', +'_types.aggregations.TimeSeriesAggregation': '_types/aggregations/bucket.ts#L1069-L1082', '_types.aggregations.TimeSeriesBucket': '_types/aggregations/Aggregate.ts#L806-L808', '_types.aggregations.TopHitsAggregate': '_types/aggregations/Aggregate.ts#L820-L826', '_types.aggregations.TopHitsAggregation': '_types/aggregations/metric.ts#L373-L433', @@ -652,7 +652,7 @@ '_types.aggregations.ValueCountAggregation': '_types/aggregations/metric.ts#L461-L461', '_types.aggregations.ValueType': '_types/aggregations/metric.ts#L463-L474', '_types.aggregations.VariableWidthHistogramAggregate': '_types/aggregations/Aggregate.ts#L473-L475', -'_types.aggregations.VariableWidthHistogramAggregation': '_types/aggregations/bucket.ts#L1117-L1141', +'_types.aggregations.VariableWidthHistogramAggregation': '_types/aggregations/bucket.ts#L1127-L1151', '_types.aggregations.VariableWidthHistogramBucket': '_types/aggregations/Aggregate.ts#L477-L484', '_types.aggregations.WeightedAverageAggregation': '_types/aggregations/metric.ts#L476-L490', '_types.aggregations.WeightedAverageValue': '_types/aggregations/metric.ts#L492-L502', @@ -1729,7 +1729,7 @@ 'indices.put_data_stream_options.Response': 'indices/put_data_stream_options/IndicesPutDataStreamOptionsResponse.ts#L22-L25', 'indices.put_data_stream_settings.DataStreamSettingsError': 'indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts#L71-L77', 'indices.put_data_stream_settings.IndexSettingResults': 'indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts#L57-L69', -'indices.put_data_stream_settings.Request': 'indices/put_data_stream_settings/IndicesPutDataStreamSettingsRequest.ts#L25-L78', +'indices.put_data_stream_settings.Request': 'indices/put_data_stream_settings/IndicesPutDataStreamSettingsRequest.ts#L25-L80', 'indices.put_data_stream_settings.Response': 'indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts#L23-L28', 'indices.put_data_stream_settings.UpdatedDataStreamSettings': 'indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts#L30-L55', 'indices.put_index_template.IndexTemplateMapping': 'indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L166-L193', @@ -1975,7 +1975,7 @@ 'inference.completion.Response': 'inference/completion/CompletionResponse.ts#L22-L24', 'inference.delete.Request': 'inference/delete/DeleteRequest.ts#L24-L67', 'inference.delete.Response': 'inference/delete/DeleteResponse.ts#L22-L24', -'inference.get.Request': 'inference/get/GetRequest.ts#L24-L57', +'inference.get.Request': 'inference/get/GetRequest.ts#L24-L62', 'inference.get.Response': 'inference/get/GetResponse.ts#L22-L26', 'inference.inference.Request': 'inference/inference/InferenceRequest.ts#L26-L106', 'inference.inference.Response': 'inference/inference/InferenceResponse.ts#L22-L25', @@ -2649,7 +2649,7 @@ 'nodes.stats.Request': 'nodes/stats/NodesStatsRequest.ts#L24-L103', 'nodes.stats.Response': 'nodes/stats/NodesStatsResponse.ts#L30-L32', 'nodes.stats.ResponseBase': 'nodes/stats/NodesStatsResponse.ts#L25-L28', -'nodes.usage.NodeUsage': 'nodes/usage/types.ts#L25-L30', +'nodes.usage.NodeUsage': 'nodes/usage/types.ts#L25-L43', 'nodes.usage.Request': 'nodes/usage/NodesUsageRequest.ts#L24-L73', 'nodes.usage.Response': 'nodes/usage/NodesUsageResponse.ts#L30-L32', 'nodes.usage.ResponseBase': 'nodes/usage/NodesUsageResponse.ts#L25-L28', @@ -3378,10 +3378,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/022788f56715dacad360eef25894eb4fa170ce46/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/607d25c087d8a04e4447aab448a36423d3dc4fa0/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/indices/ElasticsearchIndicesAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java index 34f2e754db..f019489bf0 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java @@ -2687,6 +2687,8 @@ public final CompletableFuture putDataStreamOption /** * Update data stream settings. *

+ * NOTE: Available in 8.19. Not available in earlier versions. + *

* This API can be used to override settings on specific data streams. These * overrides will take precedence over what is specified in the template that * the data stream matches. To prevent your data stream from getting into an @@ -2710,6 +2712,8 @@ public CompletableFuture putDataStreamSettings( /** * Update data stream settings. *

+ * NOTE: Available in 8.19. Not available in earlier versions. + *

* This API can be used to override settings on specific data streams. These * overrides will take precedence over what is specified in the template that * the data stream matches. To prevent your data stream from getting into an diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java index 3a9670b534..aab63907a3 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java @@ -2736,6 +2736,8 @@ public final PutDataStreamOptionsResponse putDataStreamOptions( /** * Update data stream settings. *

+ * NOTE: Available in 8.19. Not available in earlier versions. + *

* This API can be used to override settings on specific data streams. These * overrides will take precedence over what is specified in the template that * the data stream matches. To prevent your data stream from getting into an @@ -2759,6 +2761,8 @@ public PutDataStreamSettingsResponse putDataStreamSettings(PutDataStreamSettings /** * Update data stream settings. *

+ * NOTE: Available in 8.19. Not available in earlier versions. + *

* This API can be used to override settings on specific data streams. These * overrides will take precedence over what is specified in the template that * the data stream matches. To prevent your data stream from getting into an diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataStreamSettingsRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataStreamSettingsRequest.java index 172b9daf07..e07ef4882e 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataStreamSettingsRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataStreamSettingsRequest.java @@ -64,6 +64,8 @@ /** * Update data stream settings. *

+ * NOTE: Available in 8.19. Not available in earlier versions. + *

* This API can be used to override settings on specific data streams. These * overrides will take precedence over what is specified in the template that * the data stream matches. To prevent your data stream from getting into an diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/GetInferenceRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/GetInferenceRequest.java index 5bb7c448a5..afc69e9657 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/GetInferenceRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/GetInferenceRequest.java @@ -82,7 +82,10 @@ public static GetInferenceRequest of(Function_all or + * * will return all endpoints with the specified + * task_type if one is specified, or all endpoints for all task + * types if no task_type is specified *

* API name: {@code inference_id} */ @@ -92,7 +95,7 @@ public final String inferenceId() { } /** - * The task type + * The task type of the endpoint to return *

* API name: {@code task_type} */ @@ -124,7 +127,10 @@ private Builder(GetInferenceRequest instance) { } /** - * The inference Id + * The inference Id of the endpoint to return. Using _all or + * * will return all endpoints with the specified + * task_type if one is specified, or all endpoints for all task + * types if no task_type is specified *

* API name: {@code inference_id} */ @@ -134,7 +140,7 @@ public final Builder inferenceId(@Nullable String value) { } /** - * The task type + * The task type of the endpoint to return *

* API name: {@code task_type} */ @@ -214,6 +220,14 @@ public Builder rebuild() { SimpleEndpoint.pathEncode(request.inferenceId, buf); return buf.toString(); } + if (propsSet == (_taskType)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_inference"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.taskType.jsonValue(), buf); + buf.append("/_all"); + return buf.toString(); + } throw SimpleEndpoint.noPathTemplateFound("path"); }, @@ -240,6 +254,9 @@ public Builder rebuild() { params.put("taskType", request.taskType.jsonValue()); params.put("inferenceId", request.inferenceId); } + if (propsSet == (_taskType)) { + params.put("taskType", request.taskType.jsonValue()); + } return params; }, diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/usage/NodeUsage.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/usage/NodeUsage.java index 7d66ac91a2..2da0c98bf3 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/usage/NodeUsage.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/usage/NodeUsage.java @@ -87,28 +87,39 @@ public static NodeUsage of(Function> fn) { } /** - * Required - API name: {@code rest_actions} + * Required - The total number of times each REST endpoint has been called on + * this node since the last restart. Note that the REST endpoint names are not + * considered stable. + *

+ * API name: {@code rest_actions} */ public final Map restActions() { return this.restActions; } /** - * Required - API name: {@code since} + * Required - The timestamp for when the collection of these statistics started. + *

+ * API name: {@code since} */ public final long since() { return this.since; } /** - * Required - API name: {@code timestamp} + * Required - The timestamp for when these statistics were collected. + *

+ * API name: {@code timestamp} */ public final long timestamp() { return this.timestamp; } /** - * Required - API name: {@code aggregations} + * Required - The total number of times search aggregations have been called on + * this node since the last restart. + *

+ * API name: {@code aggregations} */ public final Map aggregations() { return this.aggregations; @@ -186,7 +197,11 @@ private Builder(NodeUsage instance) { } /** - * Required - API name: {@code rest_actions} + * Required - The total number of times each REST endpoint has been called on + * this node since the last restart. Note that the REST endpoint names are not + * considered stable. + *

+ * API name: {@code rest_actions} *

* Adds all entries of map to restActions. */ @@ -196,7 +211,11 @@ public final Builder restActions(Map map) { } /** - * Required - API name: {@code rest_actions} + * Required - The total number of times each REST endpoint has been called on + * this node since the last restart. Note that the REST endpoint names are not + * considered stable. + *

+ * API name: {@code rest_actions} *

* Adds an entry to restActions. */ @@ -206,7 +225,9 @@ public final Builder restActions(String key, Integer value) { } /** - * Required - API name: {@code since} + * Required - The timestamp for when the collection of these statistics started. + *

+ * API name: {@code since} */ public final Builder since(long value) { this.since = value; @@ -214,7 +235,9 @@ public final Builder since(long value) { } /** - * Required - API name: {@code timestamp} + * Required - The timestamp for when these statistics were collected. + *

+ * API name: {@code timestamp} */ public final Builder timestamp(long value) { this.timestamp = value; @@ -222,7 +245,10 @@ public final Builder timestamp(long value) { } /** - * Required - API name: {@code aggregations} + * Required - The total number of times search aggregations have been called on + * this node since the last restart. + *

+ * API name: {@code aggregations} *

* Adds all entries of map to aggregations. */ @@ -232,7 +258,10 @@ public final Builder aggregations(Map map) { } /** - * Required - API name: {@code aggregations} + * Required - The total number of times search aggregations have been called on + * this node since the last restart. + *

+ * API name: {@code aggregations} *

* Adds an entry to aggregations. */