mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 01:19:02 +00:00
allow for * on range queries in query parser
This commit is contained in:
parent
aef5aa0b33
commit
12e87ba865
@ -40,7 +40,7 @@ import static org.elasticsearch.index.query.support.QueryParsers.*;
|
||||
* <p>Also breaks fields with [type].[name] into a boolean query that must include the type
|
||||
* as well as the query on the name.
|
||||
*
|
||||
* @author kimchy (Shay Banon)
|
||||
* @author kimchy (shay.banon)
|
||||
*/
|
||||
public class MapperQueryParser extends QueryParser {
|
||||
|
||||
@ -57,7 +57,7 @@ public class MapperQueryParser extends QueryParser {
|
||||
setMultiTermRewriteMethod(MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT);
|
||||
}
|
||||
|
||||
@Override protected Query getFieldQuery(String field, String queryText) throws ParseException {
|
||||
@Override public Query getFieldQuery(String field, String queryText) throws ParseException {
|
||||
if (mapperService != null) {
|
||||
MapperService.SmartNameFieldMappers fieldMappers = mapperService.smartName(field);
|
||||
if (fieldMappers != null) {
|
||||
@ -77,6 +77,12 @@ public class MapperQueryParser extends QueryParser {
|
||||
}
|
||||
|
||||
@Override protected Query getRangeQuery(String field, String part1, String part2, boolean inclusive) throws ParseException {
|
||||
if ("*".equals(part1)) {
|
||||
part1 = null;
|
||||
}
|
||||
if ("*".equals(part2)) {
|
||||
part2 = null;
|
||||
}
|
||||
if (mapperService != null) {
|
||||
MapperService.SmartNameFieldMappers fieldMappers = mapperService.smartName(field);
|
||||
if (fieldMappers != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user