Your users won't appreciate your closing the searcher on them. That is, if
you have a highly concurrent system.

I don't know about 2.3.0 yet. Haven't had much chance to see the changes but
with 2.2.0 I use an atomic counter. It's not that much to program.

Regards,
John G.


-----Original Message-----
From: ZaeX [mailto:[EMAIL PROTECTED] 
Sent: Saturday, February 16, 2008 2:32 AM
To: java-user@lucene.apache.org
Subject: how to safely periodically reopen the IndexReader?

Hi, all

I've got a question here needing your help:
For my index, I opened one IndexWriter (autocommit mode) and one
IndexSearcher on it;
I have quite a lot of threads here concurrently writing new documents and
doing search in index.
the IndexWriter is flushed periodically.
as I want the IndexSearcher be able to see the latest record, I also need to
periodically reopen the underlying IndexReader.

But is it safe to just call close() on the IndexSearcher when there are
still threads using it?

or maybe I should use atomic counter to make sure there's no thread using it
before calling close() on IndexSearcher?

thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to