Make parsing strict for `geo_shape` query & filter and stricter for `common` query.
Closes #4508
This commit is contained in:
parent
bb4d3f55c0
commit
e7e1667a26
|
@ -1 +0,0 @@
|
|||
Subproject commit 2f5f78f24d8fbacf69c83ab7545654c83965e846
|
|
@ -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)) {
|
||||
|
|
|
@ -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 + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue