lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Steiger <>
Subject Re: Best Practices for indexing in Web application
Date Wed, 03 Mar 2004 07:57:17 GMT
Morus Walter wrote:

> Michael Steiger writes:
>>I am using an IndexSearcher for querying the index but for deletions I 
>>need to use the IndexReader. I now know that I can have Readers and a 
>>Writer open concurrently but IndexReader.delete can only be used if no 
>>Writer is open.
> You should be aware that an IndexSearcher uses a readonly IndexReader.
> So you can't ignore it for your considerations.
I thought so.
I'm wondering that there are no samples for this job. I do not think 
that I am the first one looking for this.

>>I want to open the IndexSearcher only while searching and close it 
> Depends on your application, but if you can, it's better to keep IndexSearcher
> open until the index changes.
> Otherwise you will have to open all the index files for each search.

Good tip. So I have to synchronize (logically) my search routine with 
any updates and if the index changes I have to close the Searcher and 
reopen it.


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

View raw message