lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Rajavuori <>
Subject RE: Searching while optimizing
Date Thu, 31 Jul 2003 19:57:21 GMT
This seems to contradict an item from the Lucene FAQ:

41. Can I modify the index while performing ongoing searches ?
Yes and no. At the time of writing this FAQ (June 2001), Lucene is not
thread safe in this regard. Here is a quote from Doug Cutting, the creator
of Lucene: 

The problems are only when you add documents or optimize an index, and then
search with an IndexReader that was constructed before those changes to the
index were made. 
A possible work around is to perform the index updates in a parable and
separate index and switch to the new index when its updating is done. The
switching may be done for example, using a variable that will points to the
directory of the current active index. Since searches have a relatively
short life time, you may discard (or resue the old index) short time after
performing the switch (this grace period should be a little longer if you
want to let all searches that involved paging through the hit list to be
completed with consistent results). 

Can you explain further?

-----Original Message-----
From: Doug Cutting []
Sent: Thursday, July 31, 2003 2:31 PM
To: Lucene Users List
Subject: Re: Searching while optimizing

Aviran Mordo wrote:
> Is it possible and safe to search an index while another thread adds
> documents or optimizes the same index?


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message