lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morus Walter <morus.wal...@tanto.de>
Subject Re: Best Practices for indexing in Web application
Date Wed, 03 Mar 2004 08:02:29 GMT
Michael Steiger writes:
> > 
> > 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.
> 
Right. The hard part is, that you shouldn't close the searcher when there
still is access the that searcher.
E.g. if you have a szenario
- do search
- index changes
- access search results
you cannot close the searcher until you accessed all search results.
But that can be done by a little bit of reference counting.

Morus

---------------------------------------------------------------------
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