lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Steiger <msli...@infoworks.at>
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 
>>afterwards.
>>
> 
> 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.

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message