@@ -62,6 +62,9 @@ public class GeoDistanceQuery extends QueryBase implements QueryVariant {
62
62
@ Nullable
63
63
private final GeoValidationMethod validationMethod ;
64
64
65
+ @ Nullable
66
+ private final Boolean ignoreUnmapped ;
67
+
65
68
// ---------------------------------------------------------------------------------------------
66
69
67
70
private GeoDistanceQuery (Builder builder ) {
@@ -72,7 +75,7 @@ private GeoDistanceQuery(Builder builder) {
72
75
this .distance = builder .distance ;
73
76
this .distanceType = builder .distanceType ;
74
77
this .validationMethod = builder .validationMethod ;
75
-
78
+ this . ignoreUnmapped = builder . ignoreUnmapped ;
76
79
}
77
80
78
81
public static GeoDistanceQuery of (Function <Builder , ObjectBuilder <GeoDistanceQuery >> fn ) {
@@ -125,6 +128,14 @@ public final GeoValidationMethod validationMethod() {
125
128
return this .validationMethod ;
126
129
}
127
130
131
+ /**
132
+ * API name: {@code ignore_unmapped}
133
+ */
134
+ @ Nullable
135
+ public final Boolean ignoreUnmapped () {
136
+ return this .ignoreUnmapped ;
137
+ }
138
+
128
139
protected void serializeInternal (JsonGenerator generator , JsonpMapper mapper ) {
129
140
generator .writeKey (this .field );
130
141
this .location .serialize (generator , mapper );
@@ -144,10 +155,19 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
144
155
this .validationMethod .serialize (generator , mapper );
145
156
}
146
157
158
+ if (this .ignoreUnmapped != null ) {
159
+ generator .writeKey ("ignore_unmapped" );
160
+ generator .write (this .ignoreUnmapped );
161
+ }
147
162
}
148
163
149
164
public Builder toBuilder () {
150
- return toBuilder (new Builder ()).field (field ).location (location );
165
+ return toBuilder (new Builder ()).field (field )
166
+ .location (location )
167
+ .distance (distance )
168
+ .distanceType (distanceType )
169
+ .validationMethod (validationMethod )
170
+ .ignoreUnmapped (ignoreUnmapped );
151
171
}
152
172
153
173
// ---------------------------------------------------------------------------------------------
@@ -193,6 +213,9 @@ public final Builder location(Function<GeoLocation.Builder, ObjectBuilder<GeoLoc
193
213
@ Nullable
194
214
private GeoValidationMethod validationMethod ;
195
215
216
+ @ Nullable
217
+ private Boolean ignoreUnmapped ;
218
+
196
219
/**
197
220
* API name: {@code distance}
198
221
*/
@@ -217,6 +240,14 @@ public final Builder validationMethod(@Nullable GeoValidationMethod value) {
217
240
return this ;
218
241
}
219
242
243
+ /**
244
+ * API name: {@code ignore_unmapped}
245
+ */
246
+ public final Builder ignoreUnmapped (@ Nullable Boolean value ) {
247
+ this .ignoreUnmapped = value ;
248
+ return this ;
249
+ }
250
+
220
251
@ Override
221
252
protected Builder self () {
222
253
return this ;
@@ -250,6 +281,7 @@ protected static void setupGeoDistanceQueryDeserializer(ObjectDeserializer<GeoDi
250
281
op .add (Builder ::distance , JsonpDeserializer .stringDeserializer (), "distance" );
251
282
op .add (Builder ::distanceType , GeoDistanceType ._DESERIALIZER , "distance_type" );
252
283
op .add (Builder ::validationMethod , GeoValidationMethod ._DESERIALIZER , "validation_method" );
284
+ op .add (Builder ::ignoreUnmapped , JsonpDeserializer .booleanDeserializer (), "ignore_unmapped" );
253
285
254
286
op .setUnknownFieldHandler ((builder , name , parser , mapper ) -> {
255
287
builder .field (name );
0 commit comments