Enable Geo-Shape Relations Within and Disjoint

This commit is contained in:
Simon Willnauer 2013-04-18 10:19:42 +02:00
parent 2219925485
commit 758a4fcdc0
3 changed files with 2 additions and 10 deletions

View File

@ -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)) {

View File

@ -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) {

View File

@ -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()