public Query rewrite(IndexReader reader) throws IOException {
if (transform == TRANSFORM_NONE) {
Query stdRangeQueryImpl
= new org.apache.lucene.search.RangeQuery(lowerTerm, upperTerm, inclusive);
try {
stdRangeQuery = stdRangeQueryImpl.rewrite(reader);
return stdRangeQuery;
} catch (BooleanQuery.TooManyClauses e) {
log.debug("Too many terms to enumerate, using custom RangeQuery");
// failed, use own implementation
return this;