Re: IndexReader.reopen() question

2011-03-04 Thread Lee
Thanks Ian, and Mike -- the code below was the result of badly copying the Javadocs in exasperation and panic: all points taken with gratitude. Cheers Lee On 04/03/2011 16:40, Ian Lea wrote: Looks basically OK to me. I wonder if you need the isCurrent() check as well as if (newReader != reade

Re: IndexReader.reopen() question

2011-03-04 Thread Michael McCandless
On Fri, Mar 4, 2011 at 8:20 AM, Lee Goddard wrote: > Does this look correct?  I am told it is not functioning, in that new > entries to the index are not being picked-up? Also be careful w/ threads -- if queries are "in flight", closing the reader out from other them will cause problems. -- Mi

Re: IndexReader.reopen() question

2011-03-04 Thread Ian Lea
Looks basically OK to me. I wonder if you need the isCurrent() check as well as if (newReader != reader) but shouldn't do any harm. Likewise there doesn't seem much point in reassigning reader and creating a new searcher if newReader is the same as reader. But I don't think that either of those w

IndexReader.reopen() question

2011-03-04 Thread Lee Goddard
Hello list, Does this look correct? I am told it is not functioning, in that new entries to the index are not being picked-up? Thanks Lee try { if (! reader.isCurrent()){ IndexReader newReader = reader.reopen(); if (newReader != reader) {