}
} else if (highlightCnstScrRngQuery && query instanceof ConstantScoreRangeQuery) {
ConstantScoreRangeQuery q = (ConstantScoreRangeQuery) query;
Term lower = new Term(fieldName, q.getLowerVal());
Term upper = new Term(fieldName, q.getUpperVal());
FilterIndexReader fir = new FilterIndexReader(getReaderForField(fieldName));
try {
TermEnum te = fir.terms(lower);
BooleanQuery bq = new BooleanQuery();
do {
Term term = te.term();
if (term != null && upper.compareTo(term) >= 0) {
bq.add(new BooleanClause(new TermQuery(term), BooleanClause.Occur.SHOULD));
} else {
break;
}
} while (te.next());
extract(bq, terms);
} finally {
fir.close();
}
}
}