mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-27 18:38:41 +00:00
Deprecate coerce/ignore_malformed for GeoBoundingBoxQuery
This commit is contained in:
parent
3f743a30cf
commit
a19c426e0f
@ -505,6 +505,42 @@ public class GeoBoundingBoxQueryBuilderTests extends AbstractQueryTestCase<GeoBo
|
||||
}
|
||||
}
|
||||
|
||||
public void testFromJsonCoerceFails() throws IOException {
|
||||
String json =
|
||||
"{\n" +
|
||||
" \"geo_bounding_box\" : {\n" +
|
||||
" \"pin.location\" : {\n" +
|
||||
" \"top_left\" : [ -74.1, 40.73 ],\n" +
|
||||
" \"bottom_right\" : [ -71.12, 40.01 ]\n" +
|
||||
" },\n" +
|
||||
" \"coerce\" : true,\n" +
|
||||
" \"type\" : \"MEMORY\",\n" +
|
||||
" \"ignore_unmapped\" : false,\n" +
|
||||
" \"boost\" : 1.0\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> parseQuery(json));
|
||||
assertTrue(e.getMessage().startsWith("Deprecated field "));
|
||||
}
|
||||
|
||||
public void testFromJsonIgnoreMalformedFails() throws IOException {
|
||||
String json =
|
||||
"{\n" +
|
||||
" \"geo_bounding_box\" : {\n" +
|
||||
" \"pin.location\" : {\n" +
|
||||
" \"top_left\" : [ -74.1, 40.73 ],\n" +
|
||||
" \"bottom_right\" : [ -71.12, 40.01 ]\n" +
|
||||
" },\n" +
|
||||
" \"ignore_malformed\" : true,\n" +
|
||||
" \"type\" : \"MEMORY\",\n" +
|
||||
" \"ignore_unmapped\" : false,\n" +
|
||||
" \"boost\" : 1.0\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> parseQuery(json));
|
||||
assertTrue(e.getMessage().startsWith("Deprecated field "));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testMustRewrite() throws IOException {
|
||||
assumeTrue("test runs only when at least a type is registered", getCurrentTypes().length > 0);
|
||||
|
@ -131,6 +131,8 @@ in favour of `query` and `no_match_query`.
|
||||
* Deprecated support for the coerce, normalize, ignore_malformed parameters in GeoDistanceRangeQuery. Use parameter validation_method instead.
|
||||
|
||||
* Deprecated support for the coerce, normalize, ignore_malformed parameters in GeoDistanceQuery. Use parameter validation_method instead.
|
||||
|
||||
* Deprecated support for the coerce, normalize, ignore_malformed parameters in GeoBoundingBoxQuery. Use parameter validation_method instead.
|
||||
==== Top level `filter` parameter
|
||||
|
||||
Removed support for the deprecated top level `filter` in the search api,
|
||||
|
@ -52,8 +52,9 @@ Then the following simple query can be executed with a
|
||||
|Option |Description
|
||||
|`_name` |Optional name field to identify the filter
|
||||
|
||||
|`ignore_malformed` |Set to `true` to
|
||||
accept geo points with invalid latitude or longitude (default is `false`).
|
||||
|`validation_method` |Set to `IGNORE_MALFORMED` to
|
||||
accept geo points with invalid latitude or longitude, set to
|
||||
`COERCE` to also try to infer correct latitude or longitude. (default is `STRICT`).
|
||||
|
||||
|`type` |Set to one of `indexed` or `memory` to defines whether this filter will
|
||||
be executed in memory or indexed. See <<geo-bbox-type,Type>> below for further details
|
||||
|
Loading…
x
Reference in New Issue
Block a user