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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to