Skip to content

Commit ab90ea6

Browse files
authored
Fixes from pr 2412 backport 7.17 (#747)
* fixes from pr 2412 * removed old generated files
1 parent 0d3acde commit ab90ea6

21 files changed

+751
-366
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2083,7 +2083,8 @@ public final <TDocument, TPartialDocument> CompletableFuture<UpdateResponse<TDoc
20832083
// ----- Endpoint: update_by_query
20842084

20852085
/**
2086-
* Performs an update on every document in the index without changing the
2086+
* Updates documents that match the specified query. If no query is specified,
2087+
* performs an update on every document in the index without changing the
20872088
* source, for example to pick up a mapping change.
20882089
*
20892090
* @see <a href=
@@ -2099,7 +2100,8 @@ public CompletableFuture<UpdateByQueryResponse> updateByQuery(UpdateByQueryReque
20992100
}
21002101

21012102
/**
2102-
* Performs an update on every document in the index without changing the
2103+
* Updates documents that match the specified query. If no query is specified,
2104+
* performs an update on every document in the index without changing the
21032105
* source, for example to pick up a mapping change.
21042106
*
21052107
* @param fn

java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,8 @@ public final <TDocument, TPartialDocument> UpdateResponse<TDocument> update(
21252125
// ----- Endpoint: update_by_query
21262126

21272127
/**
2128-
* Performs an update on every document in the index without changing the
2128+
* Updates documents that match the specified query. If no query is specified,
2129+
* performs an update on every document in the index without changing the
21292130
* source, for example to pick up a mapping change.
21302131
*
21312132
* @see <a href=
@@ -2142,7 +2143,8 @@ public UpdateByQueryResponse updateByQuery(UpdateByQueryRequest request)
21422143
}
21432144

21442145
/**
2145-
* Performs an update on every document in the index without changing the
2146+
* Updates documents that match the specified query. If no query is specified,
2147+
* performs an update on every document in the index without changing the
21462148
* source, for example to pick up a mapping change.
21472149
*
21482150
* @param fn

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoDistanceQuery.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import co.elastic.clients.util.ApiTypeHelper;
3030
import co.elastic.clients.util.ObjectBuilder;
3131
import jakarta.json.stream.JsonGenerator;
32+
import java.lang.Boolean;
3233
import java.lang.String;
3334
import java.util.Objects;
3435
import java.util.function.Function;
@@ -72,6 +73,9 @@ public class GeoDistanceQuery extends QueryBase implements QueryVariant {
7273
@Nullable
7374
private final GeoValidationMethod validationMethod;
7475

76+
@Nullable
77+
private final Boolean ignoreUnmapped;
78+
7579
// ---------------------------------------------------------------------------------------------
7680

7781
private GeoDistanceQuery(Builder builder) {
@@ -82,6 +86,7 @@ private GeoDistanceQuery(Builder builder) {
8286
this.distance = builder.distance;
8387
this.distanceType = builder.distanceType;
8488
this.validationMethod = builder.validationMethod;
89+
this.ignoreUnmapped = builder.ignoreUnmapped;
8590

8691
}
8792

@@ -135,6 +140,18 @@ public final GeoValidationMethod validationMethod() {
135140
return this.validationMethod;
136141
}
137142

143+
/**
144+
* Set to <code>true</code> to ignore an unmapped field and not match any
145+
* documents for this query. Set to <code>false</code> to throw an exception if
146+
* the field is not mapped.
147+
* <p>
148+
* API name: {@code ignore_unmapped}
149+
*/
150+
@Nullable
151+
public final Boolean ignoreUnmapped() {
152+
return this.ignoreUnmapped;
153+
}
154+
138155
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
139156
generator.writeKey(this.field);
140157
this.location.serialize(generator, mapper);
@@ -153,6 +170,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
153170
generator.writeKey("validation_method");
154171
this.validationMethod.serialize(generator, mapper);
155172
}
173+
if (this.ignoreUnmapped != null) {
174+
generator.writeKey("ignore_unmapped");
175+
generator.write(this.ignoreUnmapped);
176+
177+
}
156178

157179
}
158180

@@ -199,6 +221,9 @@ public final Builder location(Function<GeoLocation.Builder, ObjectBuilder<GeoLoc
199221
@Nullable
200222
private GeoValidationMethod validationMethod;
201223

224+
@Nullable
225+
private Boolean ignoreUnmapped;
226+
202227
/**
203228
* API name: {@code distance}
204229
*/
@@ -223,6 +248,18 @@ public final Builder validationMethod(@Nullable GeoValidationMethod value) {
223248
return this;
224249
}
225250

251+
/**
252+
* Set to <code>true</code> to ignore an unmapped field and not match any
253+
* documents for this query. Set to <code>false</code> to throw an exception if
254+
* the field is not mapped.
255+
* <p>
256+
* API name: {@code ignore_unmapped}
257+
*/
258+
public final Builder ignoreUnmapped(@Nullable Boolean value) {
259+
this.ignoreUnmapped = value;
260+
return this;
261+
}
262+
226263
@Override
227264
protected Builder self() {
228265
return this;
@@ -254,6 +291,7 @@ protected static void setupGeoDistanceQueryDeserializer(ObjectDeserializer<GeoDi
254291
op.add(Builder::distance, JsonpDeserializer.stringDeserializer(), "distance");
255292
op.add(Builder::distanceType, GeoDistanceType._DESERIALIZER, "distance_type");
256293
op.add(Builder::validationMethod, GeoValidationMethod._DESERIALIZER, "validation_method");
294+
op.add(Builder::ignoreUnmapped, JsonpDeserializer.booleanDeserializer(), "ignore_unmapped");
257295

258296
op.setUnknownFieldHandler((builder, name, parser, mapper) -> {
259297
builder.field(name);

java-client/src/main/java/co/elastic/clients/elasticsearch/core/UpdateByQueryRequest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@
7171
// typedef: _global.update_by_query.Request
7272

7373
/**
74-
* Performs an update on every document in the index without changing the
74+
* Updates documents that match the specified query. If no query is specified,
75+
* performs an update on every document in the index without changing the
7576
* source, for example to pick up a mapping change.
7677
*
7778
* @see <a href="../doc-files/api-spec.html#_global.update_by_query.Request">API

0 commit comments

Comments
 (0)