public Query rewrite(IndexReader reader) throws IOException {
if (transform == TRANSFORM_NONE) {
Query stdRangeQueryImpl
= new TermRangeQuery(lowerTerm.field(), lowerTerm.text(), upperTerm.text(), inclusive, 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;