Hi Erick

Our app is a long running server. Is it a problem if indexes are never closed? Our searchers do see the latest snapshot as we use writer.getReader() method for fast searches. In our case, the index is written to continously, and there are many clients reading from the index simultaneously. Our indexing process keeps the index open at all times and merely commits changes to the index. Obviously, when the server is stopped, the index is closed. When searches take place, we use getReader from the IndexWriter. Should there be a close
taking place?

Jamie




On 2010/01/26 08:54 PM, Erick Erickson wrote:
They should disappear when the last program holding them open
closes them or terminates. So I'm guessing that you have a
searcher or some such still accessing the files. This is why
your searcher doesn't see new additions until you reopen it,
the "snapshot" the literature talks about is just the old files.

Do note a common pitfall with Lucene's reopen is that reopen
does NOT close the underlying reader, you have to do that yourself.
See the docs for IndexReader.reopen, it even has a code snippet.

So no, don't worry about it *if* your program is closing its
IndexReaders/Writers correctly.

HTH
Erick

On Tue, Jan 26, 2010 at 1:20 PM, Jamie<ja...@stimulussoft.com>  wrote:



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to