> fn) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * Rank variant kind.
+ */
+ @Override
+ public Rank.Kind _rankKind() {
+ return Rank.Kind.Rrf;
+ }
+
+ /**
+ * How much influence documents in individual result sets per query have over
+ * the final ranked result set
+ *
+ * API name: {@code rank_constant}
+ */
+ @Nullable
+ public final Long rankConstant() {
+ return this.rankConstant;
+ }
+
+ /**
+ * Size of the individual result sets per query
+ *
+ * API name: {@code window_size}
+ */
+ @Nullable
+ public final Long windowSize() {
+ return this.windowSize;
+ }
+
+ /**
+ * Serialize this object to JSON.
+ */
+ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
+ generator.writeStartObject();
+ serializeInternal(generator, mapper);
+ generator.writeEnd();
+ }
+
+ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+
+ if (this.rankConstant != null) {
+ generator.writeKey("rank_constant");
+ generator.write(this.rankConstant);
+
+ }
+ if (this.windowSize != null) {
+ generator.writeKey("window_size");
+ generator.write(this.windowSize);
+
+ }
+
+ }
+
+ @Override
+ public String toString() {
+ return JsonpUtils.toString(this);
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Builder for {@link RrfRank}.
+ */
+
+ public static class Builder extends RankBase.AbstractBuilder implements ObjectBuilder {
+ @Nullable
+ private Long rankConstant;
+
+ @Nullable
+ private Long windowSize;
+
+ /**
+ * How much influence documents in individual result sets per query have over
+ * the final ranked result set
+ *
+ * API name: {@code rank_constant}
+ */
+ public final Builder rankConstant(@Nullable Long value) {
+ this.rankConstant = value;
+ return this;
+ }
+
+ /**
+ * Size of the individual result sets per query
+ *
+ * API name: {@code window_size}
+ */
+ public final Builder windowSize(@Nullable Long value) {
+ this.windowSize = value;
+ return this;
+ }
+
+ @Override
+ protected Builder self() {
+ return this;
+ }
+
+ /**
+ * Builds a {@link RrfRank}.
+ *
+ * @throws NullPointerException
+ * if some of the required fields are null.
+ */
+ public RrfRank build() {
+ _checkSingleUse();
+
+ return new RrfRank(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link RrfRank}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new,
+ RrfRank::setupRrfRankDeserializer);
+
+ protected static void setupRrfRankDeserializer(ObjectDeserializer op) {
+
+ op.add(Builder::rankConstant, JsonpDeserializer.longDeserializer(), "rank_constant");
+ op.add(Builder::windowSize, JsonpDeserializer.longDeserializer(), "window_size");
+
+ }
+
+}
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 2b1f79669..0044a840e 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
@@ -170,6 +170,8 @@ public enum Kind implements JsonEnum {
TermsSet("terms_set"),
+ TextExpansion("text_expansion"),
+
Wildcard("wildcard"),
Wrapper("wrapper"),
@@ -1109,6 +1111,23 @@ public TermsSetQuery termsSet() {
return TaggedUnionUtils.get(this, Kind.TermsSet);
}
+ /**
+ * Is this variant instance of kind {@code text_expansion}?
+ */
+ public boolean isTextExpansion() {
+ return _kind == Kind.TextExpansion;
+ }
+
+ /**
+ * Get the {@code text_expansion} variant value.
+ *
+ * @throws IllegalStateException
+ * if the current variant is not of the {@code text_expansion} kind.
+ */
+ public TextExpansionQuery textExpansion() {
+ return TaggedUnionUtils.get(this, Kind.TextExpansion);
+ }
+
/**
* Is this variant instance of kind {@code wildcard}?
*/
@@ -1745,6 +1764,17 @@ public ObjectBuilder termsSet(Function textExpansion(TextExpansionQuery v) {
+ this._kind = Kind.TextExpansion;
+ this._value = v;
+ return this;
+ }
+
+ public ObjectBuilder textExpansion(
+ Function> fn) {
+ return this.textExpansion(fn.apply(new TextExpansionQuery.Builder()).build());
+ }
+
public ObjectBuilder wildcard(WildcardQuery v) {
this._kind = Kind.Wildcard;
this._value = v;
@@ -1851,6 +1881,7 @@ protected static void setupQueryDeserializer(ObjectDeserializer op) {
op.add(Builder::term, TermQuery._DESERIALIZER, "term");
op.add(Builder::terms, TermsQuery._DESERIALIZER, "terms");
op.add(Builder::termsSet, TermsSetQuery._DESERIALIZER, "terms_set");
+ op.add(Builder::textExpansion, TextExpansionQuery._DESERIALIZER, "text_expansion");
op.add(Builder::wildcard, WildcardQuery._DESERIALIZER, "wildcard");
op.add(Builder::wrapper, WrapperQuery._DESERIALIZER, "wrapper");
op.add(Builder::type, TypeQuery._DESERIALIZER, "type");
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 45baa13ab..e72085f4c 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
@@ -914,6 +914,24 @@ public static Query termsSet(Function> fn) {
+ Query.Builder builder = new Query.Builder();
+ builder.textExpansion(fn.apply(new TextExpansionQuery.Builder()).build());
+ return builder.build();
+ }
+
/**
* Creates a builder for the {@link WildcardQuery wildcard} {@code Query}
* variant.
diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TextExpansionQuery.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TextExpansionQuery.java
new file mode 100644
index 000000000..5b3e7235d
--- /dev/null
+++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TextExpansionQuery.java
@@ -0,0 +1,200 @@
+/*
+ * 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.
+ */
+
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
+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.String;
+import java.util.Objects;
+import java.util.function.Function;
+import javax.annotation.Nullable;
+
+// typedef: _types.query_dsl.TextExpansionQuery
+
+/**
+ *
+ * @see API
+ * specification
+ */
+@JsonpDeserializable
+public class TextExpansionQuery extends QueryBase implements QueryVariant {
+ private final String value;
+
+ private final String modelId;
+
+ private final String modelText;
+
+ // ---------------------------------------------------------------------------------------------
+
+ private TextExpansionQuery(Builder builder) {
+ super(builder);
+
+ this.value = ApiTypeHelper.requireNonNull(builder.value, this, "value");
+ this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId");
+ this.modelText = ApiTypeHelper.requireNonNull(builder.modelText, this, "modelText");
+
+ }
+
+ public static TextExpansionQuery of(Function> fn) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * Query variant kind.
+ */
+ @Override
+ public Query.Kind _queryKind() {
+ return Query.Kind.TextExpansion;
+ }
+
+ /**
+ * Required - The name of the rank features field to search against
+ *
+ * API name: {@code value}
+ */
+ public final String value() {
+ return this.value;
+ }
+
+ /**
+ * Required - The text expansion NLP model to use
+ *
+ * API name: {@code model_id}
+ */
+ public final String modelId() {
+ return this.modelId;
+ }
+
+ /**
+ * Required - The query text
+ *
+ * API name: {@code model_text}
+ */
+ public final String modelText() {
+ return this.modelText;
+ }
+
+ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+
+ super.serializeInternal(generator, mapper);
+ generator.writeKey("value");
+ generator.write(this.value);
+
+ generator.writeKey("model_id");
+ generator.write(this.modelId);
+
+ generator.writeKey("model_text");
+ generator.write(this.modelText);
+
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Builder for {@link TextExpansionQuery}.
+ */
+
+ public static class Builder extends QueryBase.AbstractBuilder
+ implements
+ ObjectBuilder {
+ private String value;
+
+ private String modelId;
+
+ private String modelText;
+
+ /**
+ * Required - The name of the rank features field to search against
+ *
+ * API name: {@code value}
+ */
+ public final Builder value(String value) {
+ this.value = value;
+ return this;
+ }
+
+ /**
+ * Required - The text expansion NLP model to use
+ *
+ * API name: {@code model_id}
+ */
+ public final Builder modelId(String value) {
+ this.modelId = value;
+ return this;
+ }
+
+ /**
+ * Required - The query text
+ *
+ * API name: {@code model_text}
+ */
+ public final Builder modelText(String value) {
+ this.modelText = value;
+ return this;
+ }
+
+ @Override
+ protected Builder self() {
+ return this;
+ }
+
+ /**
+ * Builds a {@link TextExpansionQuery}.
+ *
+ * @throws NullPointerException
+ * if some of the required fields are null.
+ */
+ public TextExpansionQuery build() {
+ _checkSingleUse();
+
+ return new TextExpansionQuery(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link TextExpansionQuery}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer
+ .lazy(Builder::new, TextExpansionQuery::setupTextExpansionQueryDeserializer);
+
+ protected static void setupTextExpansionQueryDeserializer(ObjectDeserializer op) {
+ QueryBase.setupQueryBaseDeserializer(op);
+ op.add(Builder::value, JsonpDeserializer.stringDeserializer(), "value");
+ op.add(Builder::modelId, JsonpDeserializer.stringDeserializer(), "model_id");
+ op.add(Builder::modelText, JsonpDeserializer.stringDeserializer(), "model_text");
+
+ op.shortcutProperty("value");
+
+ }
+
+}
diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/ComponentTemplateSummary.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/ComponentTemplateSummary.java
index 32dd281a0..fe99ec257 100644
--- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/ComponentTemplateSummary.java
+++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/ComponentTemplateSummary.java
@@ -25,6 +25,7 @@
import co.elastic.clients.elasticsearch._types.mapping.TypeMapping;
import co.elastic.clients.elasticsearch.indices.AliasDefinition;
+import co.elastic.clients.elasticsearch.indices.DataLifecycleWithRollover;
import co.elastic.clients.elasticsearch.indices.IndexSettings;
import co.elastic.clients.json.JsonData;
import co.elastic.clients.json.JsonpDeserializable;
@@ -67,6 +68,9 @@ public class ComponentTemplateSummary implements JsonpSerializable {
private final Map aliases;
+ @Nullable
+ private final DataLifecycleWithRollover lifecycle;
+
// ---------------------------------------------------------------------------------------------
private ComponentTemplateSummary(Builder builder) {
@@ -76,6 +80,7 @@ private ComponentTemplateSummary(Builder builder) {
this.settings = ApiTypeHelper.unmodifiable(builder.settings);
this.mappings = builder.mappings;
this.aliases = ApiTypeHelper.unmodifiable(builder.aliases);
+ this.lifecycle = builder.lifecycle;
}
@@ -120,6 +125,14 @@ public final Map aliases() {
return this.aliases;
}
+ /**
+ * API name: {@code lifecycle}
+ */
+ @Nullable
+ public final DataLifecycleWithRollover lifecycle() {
+ return this.lifecycle;
+ }
+
/**
* Serialize this object to JSON.
*/
@@ -174,6 +187,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeEnd();
}
+ if (this.lifecycle != null) {
+ generator.writeKey("lifecycle");
+ this.lifecycle.serialize(generator, mapper);
+
+ }
}
@@ -206,6 +224,9 @@ public static class Builder extends WithJsonObjectBuilderBase
@Nullable
private Map aliases;
+ @Nullable
+ private DataLifecycleWithRollover lifecycle;
+
/**
* API name: {@code _meta}
*
@@ -307,6 +328,22 @@ public final Builder aliases(String key, Function> fn) {
+ return this.lifecycle(fn.apply(new DataLifecycleWithRollover.Builder()).build());
+ }
+
@Override
protected Builder self() {
return this;
@@ -341,6 +378,7 @@ protected static void setupComponentTemplateSummaryDeserializer(
op.add(Builder::settings, JsonpDeserializer.stringMapDeserializer(IndexSettings._DESERIALIZER), "settings");
op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings");
op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(AliasDefinition._DESERIALIZER), "aliases");
+ op.add(Builder::lifecycle, DataLifecycleWithRollover._DESERIALIZER, "lifecycle");
}
diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/GetComponentTemplateRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/GetComponentTemplateRequest.java
index 5a5650d08..ad62cffda 100644
--- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/GetComponentTemplateRequest.java
+++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/GetComponentTemplateRequest.java
@@ -56,6 +56,9 @@ public class GetComponentTemplateRequest extends RequestBase {
@Nullable
private final Boolean flatSettings;
+ @Nullable
+ private final Boolean includeDefaults;
+
@Nullable
private final Boolean local;
@@ -70,6 +73,7 @@ public class GetComponentTemplateRequest extends RequestBase {
private GetComponentTemplateRequest(Builder builder) {
this.flatSettings = builder.flatSettings;
+ this.includeDefaults = builder.includeDefaults;
this.local = builder.local;
this.masterTimeout = builder.masterTimeout;
this.name = builder.name;
@@ -88,6 +92,16 @@ public final Boolean flatSettings() {
return this.flatSettings;
}
+ /**
+ * Return all default configurations for the component template (default: false)
+ *
+ * API name: {@code include_defaults}
+ */
+ @Nullable
+ public final Boolean includeDefaults() {
+ return this.includeDefaults;
+ }
+
/**
* Return local information, do not retrieve the state from master node
* (default: false)
@@ -131,6 +145,9 @@ public static class Builder extends RequestBase.AbstractBuilder
@Nullable
private Boolean flatSettings;
+ @Nullable
+ private Boolean includeDefaults;
+
@Nullable
private Boolean local;
@@ -148,6 +165,16 @@ public final Builder flatSettings(@Nullable Boolean value) {
return this;
}
+ /**
+ * Return all default configurations for the component template (default: false)
+ *
+ * API name: {@code include_defaults}
+ */
+ public final Builder includeDefaults(@Nullable Boolean value) {
+ this.includeDefaults = value;
+ return this;
+ }
+
/**
* Return local information, do not retrieve the state from master node
* (default: false)
@@ -254,6 +281,9 @@ public GetComponentTemplateRequest build() {
if (request.flatSettings != null) {
params.put("flat_settings", String.valueOf(request.flatSettings));
}
+ if (request.includeDefaults != null) {
+ params.put("include_defaults", String.valueOf(request.includeDefaults));
+ }
if (request.local != null) {
params.put("local", String.valueOf(request.local));
}
diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/SearchRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/SearchRequest.java
index 8f8b43707..80c8ac554 100644
--- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/SearchRequest.java
+++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/SearchRequest.java
@@ -27,6 +27,7 @@
import co.elastic.clients.elasticsearch._types.ExpandWildcard;
import co.elastic.clients.elasticsearch._types.FieldValue;
import co.elastic.clients.elasticsearch._types.KnnQuery;
+import co.elastic.clients.elasticsearch._types.Rank;
import co.elastic.clients.elasticsearch._types.RequestBase;
import co.elastic.clients.elasticsearch._types.ScriptField;
import co.elastic.clients.elasticsearch._types.SearchType;
@@ -174,6 +175,9 @@ public class SearchRequest extends RequestBase implements JsonpSerializable {
@Nullable
private final Query query;
+ @Nullable
+ private final Rank rank;
+
@Nullable
private final Boolean requestCache;
@@ -265,6 +269,7 @@ private SearchRequest(Builder builder) {
this.profile = builder.profile;
this.q = builder.q;
this.query = builder.query;
+ this.rank = builder.rank;
this.requestCache = builder.requestCache;
this.rescore = ApiTypeHelper.unmodifiable(builder.rescore);
this.routing = builder.routing;
@@ -645,6 +650,16 @@ public final Query query() {
return this.query;
}
+ /**
+ * Defines the Reciprocal Rank Fusion (RRF) to use
+ *
+ * API name: {@code rank}
+ */
+ @Nullable
+ public final Rank rank() {
+ return this.rank;
+ }
+
/**
* Specify if request cache should be used for this request or not, defaults to
* index level setting
@@ -978,6 +993,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("query");
this.query.serialize(generator, mapper);
+ }
+ if (this.rank != null) {
+ generator.writeKey("rank");
+ this.rank.serialize(generator, mapper);
+
}
if (ApiTypeHelper.isDefined(this.rescore)) {
generator.writeKey("rescore");
@@ -1208,6 +1228,9 @@ public static class Builder extends RequestBase.AbstractBuilder impleme
@Nullable
private Query query;
+ @Nullable
+ private Rank rank;
+
@Nullable
private Boolean requestCache;
@@ -1837,6 +1860,25 @@ public final Builder query(Function> fn) {
return this.query(fn.apply(new Query.Builder()).build());
}
+ /**
+ * Defines the Reciprocal Rank Fusion (RRF) to use
+ *
+ * API name: {@code rank}
+ */
+ public final Builder rank(@Nullable Rank value) {
+ this.rank = value;
+ return this;
+ }
+
+ /**
+ * Defines the Reciprocal Rank Fusion (RRF) to use
+ *
+ * API name: {@code rank}
+ */
+ public final Builder rank(Function> fn) {
+ return this.rank(fn.apply(new Rank.Builder()).build());
+ }
+
/**
* Specify if request cache should be used for this request or not, defaults to
* index level setting
@@ -2281,6 +2323,7 @@ protected static void setupSearchRequestDeserializer(ObjectDeserializer 1) {
hash = hash.substring(1);
}
- window.location = "https://github.com/elastic/elasticsearch-specification/tree/819413aa006cfc829eb9abd18068a82d972279e7/specification/" + (paths[hash] || "");
+ window.location = "https://github.com/elastic/elasticsearch-specification/tree/0a58ae2e52dd1bc6227f65da9cbbcea5b61dde96/specification/" + (paths[hash] || "");
- Please see the Elasticsearch API specification.
+ Please see the Elasticsearch API specification.