Enable Geo-Shape Relations Within and Disjoint
This commit is contained in:
parent
2219925485
commit
758a4fcdc0
|
@ -111,9 +111,6 @@ public class GeoShapeFilterParser implements FilterParser {
|
|||
if (shapeRelation == null) {
|
||||
throw new QueryParsingException(parseContext.index(), "Unknown shape operation [" + parser.text() + "]");
|
||||
}
|
||||
if (shapeRelation != ShapeRelation.INTERSECTS) {
|
||||
throw new QueryParsingException(parseContext.index(), String.format("Unsupported shape operation [%s]. Only [%s] operation is supported", parser.text(), ShapeRelation.INTERSECTS.getRelationName()));
|
||||
}
|
||||
} else if ("strategy".equals(currentFieldName)) {
|
||||
strategyName = parser.text();
|
||||
} else if ("indexed_shape".equals(currentFieldName) || "indexedShape".equals(currentFieldName)) {
|
||||
|
|
|
@ -91,9 +91,6 @@ public class GeoShapeQueryParser implements QueryParser {
|
|||
if (shapeRelation == null) {
|
||||
throw new QueryParsingException(parseContext.index(), "Unknown shape operation [" + parser.text() + " ]");
|
||||
}
|
||||
if (shapeRelation != ShapeRelation.INTERSECTS) {
|
||||
throw new QueryParsingException(parseContext.index(), String.format("Unsupported shape operation [%s]. Only [%s] operation is supported", parser.text(), ShapeRelation.INTERSECTS.getRelationName()));
|
||||
}
|
||||
} else if ("indexed_shape".equals(currentFieldName) || "indexedShape".equals(currentFieldName)) {
|
||||
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
|
||||
if (token == XContentParser.Token.FIELD_NAME) {
|
||||
|
|
|
@ -233,11 +233,9 @@ public class GeoFilterTests extends AbstractNodesTests {
|
|||
public void testShapeRelations() throws Exception {
|
||||
|
||||
assert intersectSupport: "Intersect relation is not supported";
|
||||
// assert disjointSupport: "Disjoint relation is not supported";
|
||||
// assert withinSupport: "within relation is not supported";
|
||||
assert disjointSupport: "Disjoint relation is not supported";
|
||||
assert withinSupport: "within relation is not supported";
|
||||
|
||||
assert !disjointSupport: "Disjoint relation is now supported";
|
||||
assert !withinSupport: "within relation is now supported";
|
||||
|
||||
String mapping = XContentFactory.jsonBuilder()
|
||||
.startObject()
|
||||
|
|
Loading…
Reference in New Issue