WildcardGenerator(Term wildcard) {
this.wildcard = wildcard;
}
public void generate(IndexReader reader) throws IOException {
TermEnum enumerator = new WildcardTermEnum(reader, wildcard);
TermDocs termDocs = reader.termDocs();
try {
do {
Term term = enumerator.term();
if (term==null) break;
termDocs.seek(term);
while (termDocs.next()) {
handleDoc(termDocs.doc());
}
} while (enumerator.next());
} finally {
termDocs.close();
enumerator.close();
}
}