lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: best way of reusing IndexSearcher objects
Date Thu, 18 Dec 2003 20:13:13 GMT
Doug Cutting wrote:
> That's true.  If you're doing updates (as opposed to just additions) 
> then you probably want to do something like:
>   1. keep a single open IndexReader used by all searches
>   2. Every few minutes, process updates as follows:
>     a. open a second IndexReader
>     b. delete all documents that will be updated
>     c. close this IndexReader, to flush deletions
>     d. open an IndexWriter
>     e. add all documents that are updated
>     f. close the IndexReader
>     g. replace the IndexReader used for searches (1, above)

Correction: (f) should read "close the IndexWriter".


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

View raw message