> fn) {
return fn.apply(new Builder()).build();
}
+ /**
+ * Query variant kind.
+ */
+ @Override
+ public Query.Kind _queryKind() {
+ return Query.Kind.Knn;
+ }
+
/**
* Required - The name of the vector field to search against
*
@@ -177,6 +191,16 @@ public final Float similarity() {
return this.similarity;
}
+ /**
+ * If defined, each search hit will contain inner hits.
+ *
+ * API name: {@code inner_hits}
+ */
+ @Nullable
+ public final InnerHits innerHits() {
+ return this.innerHits;
+ }
+
/**
* Serialize this object to JSON.
*/
@@ -232,6 +256,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.write(this.similarity);
}
+ if (this.innerHits != null) {
+ generator.writeKey("inner_hits");
+ this.innerHits.serialize(generator, mapper);
+
+ }
}
@@ -268,6 +297,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement
@Nullable
private Float similarity;
+ @Nullable
+ private InnerHits innerHits;
+
/**
* Required - The name of the vector field to search against
*
@@ -399,6 +431,25 @@ public final Builder similarity(@Nullable Float value) {
return this;
}
+ /**
+ * If defined, each search hit will contain inner hits.
+ *
+ * API name: {@code inner_hits}
+ */
+ public final Builder innerHits(@Nullable InnerHits value) {
+ this.innerHits = value;
+ return this;
+ }
+
+ /**
+ * If defined, each search hit will contain inner hits.
+ *
+ * API name: {@code inner_hits}
+ */
+ public final Builder innerHits(Function> fn) {
+ return this.innerHits(fn.apply(new InnerHits.Builder()).build());
+ }
+
@Override
protected Builder self() {
return this;
@@ -436,6 +487,7 @@ protected static void setupKnnQueryDeserializer(ObjectDeserializer
implements
ObjectBuilder {
+ @Nullable
private Integer dims;
@Nullable
@@ -171,9 +175,9 @@ public static class Builder extends PropertyBase.AbstractBuilder
private DenseVectorIndexOptions indexOptions;
/**
- * Required - API name: {@code dims}
+ * API name: {@code dims}
*/
- public final Builder dims(int value) {
+ public final Builder dims(@Nullable Integer value) {
this.dims = value;
return this;
}
diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/GeoPointProperty.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/GeoPointProperty.java
index 7610ffba0..956f2e502 100644
--- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/GeoPointProperty.java
+++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/GeoPointProperty.java
@@ -20,6 +20,7 @@
package co.elastic.clients.elasticsearch._types.mapping;
import co.elastic.clients.elasticsearch._types.GeoLocation;
+import co.elastic.clients.elasticsearch._types.Script;
import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;
import co.elastic.clients.json.JsonpMapper;
@@ -66,6 +67,15 @@ public class GeoPointProperty extends DocValuesPropertyBase implements PropertyV
@Nullable
private final GeoLocation nullValue;
+ @Nullable
+ private final Boolean index;
+
+ @Nullable
+ private final OnScriptError onScriptError;
+
+ @Nullable
+ private final Script script;
+
// ---------------------------------------------------------------------------------------------
private GeoPointProperty(Builder builder) {
@@ -74,6 +84,9 @@ private GeoPointProperty(Builder builder) {
this.ignoreMalformed = builder.ignoreMalformed;
this.ignoreZValue = builder.ignoreZValue;
this.nullValue = builder.nullValue;
+ this.index = builder.index;
+ this.onScriptError = builder.onScriptError;
+ this.script = builder.script;
}
@@ -113,6 +126,30 @@ public final GeoLocation nullValue() {
return this.nullValue;
}
+ /**
+ * API name: {@code index}
+ */
+ @Nullable
+ public final Boolean index() {
+ return this.index;
+ }
+
+ /**
+ * API name: {@code on_script_error}
+ */
+ @Nullable
+ public final OnScriptError onScriptError() {
+ return this.onScriptError;
+ }
+
+ /**
+ * API name: {@code script}
+ */
+ @Nullable
+ public final Script script() {
+ return this.script;
+ }
+
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.write("type", "geo_point");
@@ -132,6 +169,20 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.nullValue.serialize(generator, mapper);
}
+ if (this.index != null) {
+ generator.writeKey("index");
+ generator.write(this.index);
+
+ }
+ if (this.onScriptError != null) {
+ generator.writeKey("on_script_error");
+ this.onScriptError.serialize(generator, mapper);
+ }
+ if (this.script != null) {
+ generator.writeKey("script");
+ this.script.serialize(generator, mapper);
+
+ }
}
@@ -153,6 +204,15 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder> fn) {
+ return this.script(fn.apply(new Script.Builder()).build());
+ }
+
@Override
protected Builder self() {
return this;
@@ -215,6 +306,9 @@ protected static void setupGeoPointPropertyDeserializer(ObjectDeserializer> fn) {
@@ -73,10 +80,23 @@ public Property.Kind _propertyKind() {
return Property.Kind.RankFeatures;
}
+ /**
+ * API name: {@code positive_score_impact}
+ */
+ @Nullable
+ public final Boolean positiveScoreImpact() {
+ return this.positiveScoreImpact;
+ }
+
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.write("type", "rank_features");
super.serializeInternal(generator, mapper);
+ if (this.positiveScoreImpact != null) {
+ generator.writeKey("positive_score_impact");
+ generator.write(this.positiveScoreImpact);
+
+ }
}
@@ -89,6 +109,17 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
public static class Builder extends PropertyBase.AbstractBuilder
implements
ObjectBuilder {
+ @Nullable
+ private Boolean positiveScoreImpact;
+
+ /**
+ * API name: {@code positive_score_impact}
+ */
+ public final Builder positiveScoreImpact(@Nullable Boolean value) {
+ this.positiveScoreImpact = value;
+ return this;
+ }
+
@Override
protected Builder self() {
return this;
@@ -117,6 +148,7 @@ public RankFeaturesProperty build() {
protected static void setupRankFeaturesPropertyDeserializer(ObjectDeserializer op) {
PropertyBase.setupPropertyBaseDeserializer(op);
+ op.add(Builder::positiveScoreImpact, JsonpDeserializer.booleanDeserializer(), "positive_score_impact");
op.ignore("type");
}
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 b373897d9..fad0416e5 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
@@ -19,6 +19,7 @@
package co.elastic.clients.elasticsearch._types.query_dsl;
+import co.elastic.clients.elasticsearch._types.KnnQuery;
import co.elastic.clients.elasticsearch._types.aggregations.Aggregation;
import co.elastic.clients.elasticsearch._types.aggregations.AggregationVariant;
import co.elastic.clients.json.JsonData;
@@ -115,6 +116,8 @@ public enum Kind implements JsonEnum {
Intervals("intervals"),
+ Knn("knn"),
+
Match("match"),
MatchAll("match_all"),
@@ -560,6 +563,23 @@ public IntervalsQuery intervals() {
return TaggedUnionUtils.get(this, Kind.Intervals);
}
+ /**
+ * Is this variant instance of kind {@code knn}?
+ */
+ public boolean isKnn() {
+ return _kind == Kind.Knn;
+ }
+
+ /**
+ * Get the {@code knn} variant value.
+ *
+ * @throws IllegalStateException
+ * if the current variant is not of the {@code knn} kind.
+ */
+ public KnnQuery knn() {
+ return TaggedUnionUtils.get(this, Kind.Knn);
+ }
+
/**
* Is this variant instance of kind {@code match}?
*/
@@ -1473,6 +1493,16 @@ public ObjectBuilder intervals(Function knn(KnnQuery v) {
+ this._kind = Kind.Knn;
+ this._value = v;
+ return this;
+ }
+
+ public ObjectBuilder knn(Function> fn) {
+ return this.knn(fn.apply(new KnnQuery.Builder()).build());
+ }
+
public ObjectBuilder match(MatchQuery v) {
this._kind = Kind.Match;
this._value = v;
@@ -1919,6 +1949,7 @@ protected static void setupQueryDeserializer(ObjectDeserializer op) {
op.add(Builder::hasParent, HasParentQuery._DESERIALIZER, "has_parent");
op.add(Builder::ids, IdsQuery._DESERIALIZER, "ids");
op.add(Builder::intervals, IntervalsQuery._DESERIALIZER, "intervals");
+ op.add(Builder::knn, KnnQuery._DESERIALIZER, "knn");
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 473535e20..292600e20 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
@@ -19,6 +19,7 @@
package co.elastic.clients.elasticsearch._types.query_dsl;
+import co.elastic.clients.elasticsearch._types.KnnQuery;
import co.elastic.clients.util.ObjectBuilder;
import java.util.function.Function;
@@ -355,6 +356,22 @@ public static Query intervals(Function> fn) {
+ Query.Builder builder = new Query.Builder();
+ builder.knn(fn.apply(new KnnQuery.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/core/search/InnerHits.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/InnerHits.java
index 250b7abf0..503ea8d28 100644
--- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/InnerHits.java
+++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/InnerHits.java
@@ -102,7 +102,7 @@ public class InnerHits implements JsonpSerializable {
@Nullable
private final SourceConfig source;
- private final List storedField;
+ private final List storedFields;
@Nullable
private final Boolean trackScores;
@@ -127,7 +127,7 @@ private InnerHits(Builder builder) {
this.fields = ApiTypeHelper.unmodifiable(builder.fields);
this.sort = ApiTypeHelper.unmodifiable(builder.sort);
this.source = builder.source;
- this.storedField = ApiTypeHelper.unmodifiable(builder.storedField);
+ this.storedFields = ApiTypeHelper.unmodifiable(builder.storedFields);
this.trackScores = builder.trackScores;
this.version = builder.version;
@@ -248,10 +248,10 @@ public final SourceConfig source() {
}
/**
- * API name: {@code stored_field}
+ * API name: {@code stored_fields}
*/
- public final List storedField() {
- return this.storedField;
+ public final List storedFields() {
+ return this.storedFields;
}
/**
@@ -367,10 +367,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.source.serialize(generator, mapper);
}
- if (ApiTypeHelper.isDefined(this.storedField)) {
- generator.writeKey("stored_field");
+ if (ApiTypeHelper.isDefined(this.storedFields)) {
+ generator.writeKey("stored_fields");
generator.writeStartArray();
- for (String item0 : this.storedField) {
+ for (String item0 : this.storedFields) {
generator.write(item0);
}
@@ -442,7 +442,7 @@ public static class Builder extends WithJsonObjectBuilderBase implement
private SourceConfig source;
@Nullable
- private List storedField;
+ private List storedFields;
@Nullable
private Boolean trackScores;
@@ -667,22 +667,22 @@ public final Builder source(Function
- * Adds all elements of list
to storedField
.
+ * Adds all elements of list
to storedFields
.
*/
- public final Builder storedField(List list) {
- this.storedField = _listAddAll(this.storedField, list);
+ public final Builder storedFields(List list) {
+ this.storedFields = _listAddAll(this.storedFields, list);
return this;
}
/**
- * API name: {@code stored_field}
+ * API name: {@code stored_fields}
*
- * Adds one or more values to storedField
.
+ * Adds one or more values to storedFields
.
*/
- public final Builder storedField(String value, String... values) {
- this.storedField = _listAdd(this.storedField, value, values);
+ public final Builder storedFields(String value, String... values) {
+ this.storedFields = _listAdd(this.storedFields, value, values);
return this;
}
@@ -745,8 +745,8 @@ protected static void setupInnerHitsDeserializer(ObjectDeserializer 1) {
hash = hash.substring(1);
}
- window.location = "https://github.com/elastic/elasticsearch-specification/tree/d792c326a393769cc783482cf209435750d45029/specification/" + (paths[hash] || "");
+ window.location = "https://github.com/elastic/elasticsearch-specification/tree/0a63a19b96834d9bcaad0738cb0c6850dd326d20/specification/" + (paths[hash] || "");
- Please see the Elasticsearch API specification.
+ Please see the Elasticsearch API specification.