On 6/5/07, Michael Böckling <[EMAIL PROTECTED]> wrote:
In the docs it says that I should cache the IndexSearcher for best
performance, and not build a new one for each query.
The problem is that when I want to switch to a new index, I would have to
synchronize my search() method while my update check runs (which is also
synchronized), so searching and switching to a new index never happen at the
same time.
You only have to synchronize handing out the searcher to another query
thread... the search method itself shouldn't need to be synchronized.
When a new searcher is opened, it can be handed to new request threads
while old request threads finish up with the old searcher... after the
old searcher is no longer used, close it (requires ref counting).
Check out how Solr does it: SolrCore.getSearcher() / registerSearcher()
-Yonik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]