On Sun, Jan 17, 2010 at 4:04 PM, Robin Anil <robin.a...@gmail.com> wrote: > > public int get(String word) throws IOException { > Term t = queryTerm.createTerm(word); > TermDocs docs = ireader.termDocs(t); > if(docs.next() == false) return -1; > return docs.doc(); > } > >
Not sure if this will help you significantly, but you could possibly reuse the TermDocs object. Create TermDocs when you initialize the reader. Pass that object to get method above. In the method, use TermDocs.seek(Term) method. --shashi