checkLower = true;
}
String testField = getField();
TermDocs docs = reader.termDocs();
try {
do {
Term term = enumerator.term();
if (term != null && term.field() == testField) {
if (!checkLower || term.text().compareTo(lowerTerm.text()) > 0) {
checkLower = false;
if (upperTerm != null) {
int compare = upperTerm.text().compareTo(term.text());
// if beyond the upper term, or is exclusive and
// this is equal to the upper term, break out
if ((compare < 0) || (!inclusive && compare == 0)) {
break;
}
}
docs.seek(enumerator);
while (docs.next()) {
hits.set(docs.doc());
}
}
} else {
break;
}
} while (enumerator.next());
} finally {
docs.close();
}
} finally {
enumerator.close();
}
hitsCalculated = true;