lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: Parallel search in MultiSearcher
Date Wed, 07 Jan 2004 22:48:33 GMT
Jean-Francois Halleux wrote:
> 	as suggested, here is a patch that should parallelize searches among the
> various searchables in a MultiSearcher. I only have a single HDD machine but
> I guess that spreading index files over multiple HDD can greatly improve
> search time when using this MultiSearcher.
> This passes ANT test but be careful as it's been a while since I've
> programmed and I don't know Lucene well.

That was quick!  I have two suggestions.

First, I think it might be best if this is a subclass of MultiSearcher, 
so that the old sequential version is still available.

Second, I think the following synchronization goes too far:

> +			   synchronized (MultiSearcherThread.class) {
> +				   if(!hq.insert(scoreDoc)) break;
> +			   }                              // no more scores > minScore

Wouldn't it be sufficient to synchronize on 'hq', e.g.:

   synchronized (hq) {
     if(!hq.insert(scoreDoc)) break;


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

View raw message