File tree Expand file tree Collapse file tree 2 files changed +24
-9
lines changed
main/java/org/elasticsearch/index/query
test/java/org/elasticsearch/index/query Expand file tree Collapse file tree 2 files changed +24
-9
lines changed Original file line number Diff line number Diff line change @@ -294,8 +294,7 @@ protected static List<List<List<GeoPoint>>> parseMultiPolygon(XContentParser par
294294 return polygons ;
295295 }
296296
297- public static GeoPolygonQueryBuilder fromXContent (QueryParseContext parseContext ) throws IOException {
298- XContentParser parser = parseContext .parser ();
297+ public static GeoPolygonQueryBuilder fromXContent (XContentParser parser ) throws IOException {
299298 String fieldName = null ;
300299
301300 List shell = null ;
@@ -322,7 +321,7 @@ public static GeoPolygonQueryBuilder fromXContent(QueryParseContext parseContext
322321 while ((token = parser .nextToken ()) != Token .END_ARRAY ) {
323322 shell .add (GeoUtils .parseGeoPoint (parser ));
324323 }
325- } else if (parseContext . getParseFieldMatcher (). match (currentFieldName , MULTIPOLYGON_FIELD )) {
324+ } else if (MULTIPOLYGON_FIELD . match (currentFieldName , parser . getDeprecationHandler () )) {
326325 // parse a multipolygon as defined in the GeoJSON spec
327326 // Note: shape validation is not performed, possible todo but perhaps overkill
328327 shell = parseMultiPolygon (parser );
Original file line number Diff line number Diff line change @@ -196,15 +196,31 @@ public void testParsingAndToQuery4() throws IOException {
196196 }
197197
198198 public void testParsingAndToQuery5 () throws IOException {
199- assumeTrue ("test runs only when at least a type is registered" , getCurrentTypes ().length > 0 );
200199 String query = "{\n " +
201200 " \" geo_polygon\" :{\n " +
202201 " \" " + GEO_POINT_FIELD_NAME + "\" :{\n " +
203- " \" multipolygon\" :[ [ [\n " +
204- " [-70, 40],\n " +
205- " [-80, 30],\n " +
206- " [-90, 20]\n " +
207- " ] ] ]\n " +
202+ " \" multipolygon\" :[\n " +
203+ " [\n " +
204+ " [[-70, 40],\n " +
205+ " [-80, 30],\n " +
206+ " [-90, 20]]\n " +
207+ " ],\n " +
208+ " [\n " +
209+ " [[70, 40],\n " +
210+ " [80, 30],\n " +
211+ " [90, 20]]\n " +
212+ " ],\n " +
213+ " [\n " +
214+ " [[-10, -10],\n " +
215+ " [10, -10],\n " +
216+ " [10, 10],\n " +
217+ " [-10, 10]],\n " +
218+ " [[-5, -5],\n " +
219+ " [5, -5],\n " +
220+ " [5, 5],\n " +
221+ " [-5, 5]]\n " +
222+ " ]\n " +
223+ " ]\n " +
208224 " }\n " +
209225 " }\n " +
210226 "}\n " ;
You can’t perform that action at this time.
0 commit comments