You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Christoph Kaser <lu...@iconparc.de> on 2012/05/08 13:31:53 UTC

Parallel searching use ExecutorService and Collectors

Hi all,

I want to speed up my searches by using multiple CPU cores for one 
search. I saw that there is a possibility to use multithreaded search by 
passing an ExecutorService to the IndexSearcher:

     idxSearcher = new IndexSearcher(reader, 
Executors.newCachedThreadPool());

I call my search using:

     idxSearcher.search(query, filter, collector);

However, I found that this has no effect on search speed at all. After 
some digging, I found out that the multithreading apparently does not 
work when calling the search with a custom collector implementation, the 
source code even says:

      // TODO: should we make this
     // threaded...?  the Collector could be sync'd?
     // always use single thread:

Does anyone know, whether there is work currently going on to address 
this issue? If not, is there a workaround that allows me to use multiple 
threads for searching and still use my own collectors?

Best regards,
Christoph Kaser

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