lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Galiana" <>
Subject RE: Searching while optimizing
Date Fri, 01 Aug 2003 08:58:31 GMT
Ok, would be possible the next scenary?

1. We run an IndeWriter and several IndexSearch runs in parallel.
IndexWriter is open all time. There are two contexts in Tomcat, one to Index
and the other to search and administrative works.
2. The context "search" creates an IndexSearch
3. At the same time arrives a document to be indexed.
4. the context "indexer" uses the IndexWriter to add the document, and it
needs to do a merge and creates and deletes segments.
5. When IndexSearch is goint be used the files are changed, and don´t found

It´s possible?
Jose galiana

-----Mensaje original-----
De: Steve Rajavuori []
Enviado el: jueves, 31 de julio de 2003 21:57
Para: 'Lucene Users List'
Asunto: RE: Searching while optimizing

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