use of org.apache.lucene.search.IndexOrDocValuesQuery in project crate by crate.
the class LongEqQuery method rangeQuery.
@Override
public Query rangeQuery(String field, Long lowerTerm, Long upperTerm, boolean includeLower, boolean includeUpper) {
long lower = lowerTerm == null ? Long.MIN_VALUE : (includeLower ? lowerTerm : lowerTerm + 1);
long upper = upperTerm == null ? Long.MAX_VALUE : (includeUpper ? upperTerm : upperTerm - 1);
Query indexQuery = LongPoint.newRangeQuery(field, lower, upper);
return new IndexOrDocValuesQuery(indexQuery, SortedNumericDocValuesField.newSlowRangeQuery(field, lower, upper));
}
Aggregations