Make parsing strict for `geo_shape` query & filter and stricter for `common` query.

Closes #4508
This commit is contained in:
Martijn van Groningen 2013-12-18 16:39:15 +01:00
parent bb4d3f55c0
commit e7e1667a26
4 changed files with 11 additions and 1 deletions

@ -1 +0,0 @@
Subproject commit 2f5f78f24d8fbacf69c83ab7545654c83965e846

1
rest-spec Symbolic link
View File

@ -0,0 +1 @@
../elasticsearch-rest-api-spec/

View File

@ -104,6 +104,8 @@ public class CommonTermsQueryParser implements QueryParser {
}
}
}
} else {
throw new QueryParsingException(parseContext.index(), "[common] query does not support [" + currentFieldName + "]");
}
} else if (token.isValue()) {
if ("query".equals(currentFieldName)) {

View File

@ -135,6 +135,8 @@ public class GeoShapeFilterParser implements FilterParser {
throw new QueryParsingException(parseContext.index(), "Type for indexed shape not provided");
}
shape = fetchService.fetch(id, type, index, shapeFieldName);
} else {
throw new QueryParsingException(parseContext.index(), "[geo_shape] filter does not support [" + currentFieldName + "]");
}
}
}
@ -145,6 +147,8 @@ public class GeoShapeFilterParser implements FilterParser {
cache = parser.booleanValue();
} else if ("_cache_key".equals(currentFieldName)) {
cacheKey = new CacheKeyFilter.Key(parser.text());
} else {
throw new QueryParsingException(parseContext.index(), "[geo_shape] filter does not support [" + currentFieldName + "]");
}
}
}

View File

@ -113,6 +113,8 @@ public class GeoShapeQueryParser implements QueryParser {
throw new QueryParsingException(parseContext.index(), "Type for indexed shape not provided");
}
shape = fetchService.fetch(id, type, index, shapeFieldName);
} else {
throw new QueryParsingException(parseContext.index(), "[geo_shape] query does not support [" + currentFieldName + "]");
}
}
}
@ -121,6 +123,8 @@ public class GeoShapeQueryParser implements QueryParser {
boost = parser.floatValue();
} else if ("_name".equals(currentFieldName)) {
queryName = parser.text();
} else {
throw new QueryParsingException(parseContext.index(), "[geo_shape] query does not support [" + currentFieldName + "]");
}
}
}