|
@@ -78,7 +78,6 @@ public class GeoBoundingBoxQueryBuilderTests extends AbstractQueryTestCase<GeoBo
|
|
|
builder.ignoreUnmapped(randomBoolean());
|
|
|
}
|
|
|
|
|
|
- builder.type(randomFrom(GeoExecType.values()));
|
|
|
return builder;
|
|
|
}
|
|
|
|
|
@@ -87,18 +86,6 @@ public class GeoBoundingBoxQueryBuilderTests extends AbstractQueryTestCase<GeoBo
|
|
|
assertEquals("Field name must not be empty.", e.getMessage());
|
|
|
}
|
|
|
|
|
|
- public void testValidationNullType() {
|
|
|
- GeoBoundingBoxQueryBuilder qb = new GeoBoundingBoxQueryBuilder("teststring");
|
|
|
- IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> qb.type((GeoExecType) null));
|
|
|
- assertEquals("Type is not allowed to be null.", e.getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- public void testValidationNullTypeString() {
|
|
|
- GeoBoundingBoxQueryBuilder qb = new GeoBoundingBoxQueryBuilder("teststring");
|
|
|
- IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> qb.type((String) null));
|
|
|
- assertEquals("cannot parse type from null string", e.getMessage());
|
|
|
- }
|
|
|
-
|
|
|
public void testExceptionOnMissingTypes() {
|
|
|
SearchExecutionContext context = createShardContextWithNoType();
|
|
|
GeoBoundingBoxQueryBuilder qb = createTestQueryBuilder();
|
|
@@ -376,8 +363,7 @@ public class GeoBoundingBoxQueryBuilderTests extends AbstractQueryTestCase<GeoBo
|
|
|
" \"bottom_right\" : [ -71.12, 40.01 ]\n" +
|
|
|
" },\n" +
|
|
|
" \"validation_method\" : \"STRICT\",\n" +
|
|
|
- " \"type\" : \"MEMORY\",\n" +
|
|
|
- " \"ignore_unmapped\" : false,\n" +
|
|
|
+ " \"ignore_unmapped\" : false,\n" +
|
|
|
" \"boost\" : 1.0\n" +
|
|
|
" }\n" +
|
|
|
"}";
|
|
@@ -389,8 +375,6 @@ public class GeoBoundingBoxQueryBuilderTests extends AbstractQueryTestCase<GeoBo
|
|
|
assertEquals(json, -71.12, parsed.bottomRight().getLon(), 0.0001);
|
|
|
assertEquals(json, 40.01, parsed.bottomRight().getLat(), 0.0001);
|
|
|
assertEquals(json, 1.0, parsed.boost(), 0.0001);
|
|
|
- assertEquals(json, GeoExecType.MEMORY, parsed.type());
|
|
|
- assertDeprecationWarning();
|
|
|
}
|
|
|
|
|
|
public void testFromWKT() throws IOException {
|
|
@@ -401,7 +385,6 @@ public class GeoBoundingBoxQueryBuilderTests extends AbstractQueryTestCase<GeoBo
|
|
|
" \"wkt\" : \"BBOX (-74.1, -71.12, 40.73, 40.01)\"\n" +
|
|
|
" },\n" +
|
|
|
" \"validation_method\" : \"STRICT\",\n" +
|
|
|
- " \"type\" : \"MEMORY\",\n" +
|
|
|
" \"ignore_unmapped\" : false,\n" +
|
|
|
" \"boost\" : 1.0\n" +
|
|
|
" }\n" +
|
|
@@ -417,7 +400,6 @@ public class GeoBoundingBoxQueryBuilderTests extends AbstractQueryTestCase<GeoBo
|
|
|
" \"bottom_right\" : [ -71.12, 40.01 ]\n" +
|
|
|
" },\n" +
|
|
|
" \"validation_method\" : \"STRICT\",\n" +
|
|
|
- " \"type\" : \"MEMORY\",\n" +
|
|
|
" \"ignore_unmapped\" : false,\n" +
|
|
|
" \"boost\" : 1.0\n" +
|
|
|
" }\n" +
|
|
@@ -434,8 +416,6 @@ public class GeoBoundingBoxQueryBuilderTests extends AbstractQueryTestCase<GeoBo
|
|
|
assertEquals(expectedJson, -71.12, parsed.bottomRight().getLon(), delta);
|
|
|
assertEquals(expectedJson, 40.01, parsed.bottomRight().getLat(), delta);
|
|
|
assertEquals(expectedJson, 1.0, parsed.boost(), delta);
|
|
|
- assertEquals(expectedJson, GeoExecType.MEMORY, parsed.type());
|
|
|
- assertDeprecationWarning();
|
|
|
}
|
|
|
|
|
|
public void testFromGeohash() throws IOException {
|
|
@@ -447,7 +427,6 @@ public class GeoBoundingBoxQueryBuilderTests extends AbstractQueryTestCase<GeoBo
|
|
|
" \"bottom_right\" : \"dq\"\n" +
|
|
|
" },\n" +
|
|
|
" \"validation_method\" : \"STRICT\",\n" +
|
|
|
- " \"type\" : \"MEMORY\",\n" +
|
|
|
" \"ignore_unmapped\" : false,\n" +
|
|
|
" \"boost\" : 1.0\n" +
|
|
|
" }\n" +
|
|
@@ -461,7 +440,6 @@ public class GeoBoundingBoxQueryBuilderTests extends AbstractQueryTestCase<GeoBo
|
|
|
" \"bottom_right\" : [ -67.5, 33.75 ]\n" +
|
|
|
" },\n" +
|
|
|
" \"validation_method\" : \"STRICT\",\n" +
|
|
|
- " \"type\" : \"MEMORY\",\n" +
|
|
|
" \"ignore_unmapped\" : false,\n" +
|
|
|
" \"boost\" : 1.0\n" +
|
|
|
" }\n" +
|
|
@@ -474,8 +452,6 @@ public class GeoBoundingBoxQueryBuilderTests extends AbstractQueryTestCase<GeoBo
|
|
|
assertEquals(json, -67.5, parsed.bottomRight().getLon(), 0.0001);
|
|
|
assertEquals(json, 33.75, parsed.bottomRight().getLat(), 0.0001);
|
|
|
assertEquals(json, 1.0, parsed.boost(), 0.0001);
|
|
|
- assertEquals(json, GeoExecType.MEMORY, parsed.type());
|
|
|
- assertDeprecationWarning();
|
|
|
}
|
|
|
|
|
|
public void testMalformedGeohashes() {
|
|
@@ -487,7 +463,6 @@ public class GeoBoundingBoxQueryBuilderTests extends AbstractQueryTestCase<GeoBo
|
|
|
" \"wkt\" : \"BBOX (-74.1, -71.12, 40.73, 40.01)\"\n" +
|
|
|
" },\n" +
|
|
|
" \"validation_method\" : \"STRICT\",\n" +
|
|
|
- " \"type\" : \"MEMORY\",\n" +
|
|
|
" \"ignore_unmapped\" : false,\n" +
|
|
|
" \"boost\" : 1.0\n" +
|
|
|
" }\n" +
|
|
@@ -534,26 +509,4 @@ public class GeoBoundingBoxQueryBuilderTests extends AbstractQueryTestCase<GeoBo
|
|
|
QueryShardException e = expectThrows(QueryShardException.class, () -> failingQueryBuilder.toQuery(searchExecutionContext));
|
|
|
assertThat(e.getMessage(), containsString("failed to find geo field [unmapped]"));
|
|
|
}
|
|
|
-
|
|
|
- @Override
|
|
|
- public void testValidOutput() throws IOException {
|
|
|
- super.testValidOutput();
|
|
|
- assertDeprecationWarning();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void testUnknownField() throws IOException {
|
|
|
- super.testUnknownField();
|
|
|
- assertDeprecationWarning();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void testFromXContent() throws IOException {
|
|
|
- super.testFromXContent();
|
|
|
- assertDeprecationWarning();
|
|
|
- }
|
|
|
-
|
|
|
- private void assertDeprecationWarning() {
|
|
|
- assertWarnings("Deprecated field [type] used, this field is unused and will be removed entirely");
|
|
|
- }
|
|
|
}
|