Yep. it did help for sequential lookups. Not for random lookups which is still slow. Thinking of keeping an LRU cache to improve speed. let me see
On Sun, Jan 17, 2010 at 6:17 PM, Shashikant Kore <shashik...@gmail.com>wrote: > 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 >