Merge pull request #11607 from cbuescher/feature/query-refactoring-rangequery-fix
Fixing edge case in RangeQueryBuilder when using time zone
This commit is contained in:
commit
2a468fdcd3
|
@ -304,6 +304,10 @@ public class RangeQueryBuilder extends MultiTermQueryBuilder<RangeQueryBuilder>
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query == null) {
|
if (query == null) {
|
||||||
|
if (this.timeZone != null) {
|
||||||
|
throw new QueryParsingException(parseContext, "[range] time_zone can not be applied to non date field ["
|
||||||
|
+ fieldName + "]");
|
||||||
|
}
|
||||||
query = new TermRangeQuery(this.fieldName, BytesRefs.toBytesRef(from), BytesRefs.toBytesRef(to), includeLower, includeUpper);
|
query = new TermRangeQuery(this.fieldName, BytesRefs.toBytesRef(from), BytesRefs.toBytesRef(to), includeLower, includeUpper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue