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 amit nanda <am...@gmail.com> on 2013/06/19 10:59:28 UTC

IndexSearcher using Collector

Hi,

I have multiple index that i want to search against, thus i am
using MultiReader for that. Along with this I also want all the matches to
the query so i am using Collector class for this.

The issue i am facing is that I am not able to know when all the matches
are done, i.e. for each matching doc the collect function on the Collector
class will be called but, when all the matches are done how can i come to
know about that. The search function doesn't block.

Is there any way to get this done?

Thanks
Amit

RE: IndexSearcher using Collector

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

The search function does block. IndexSearcher.search(Query, Collector) returns when all collecting is done. You can do the after-collect work after it returns.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: amit nanda [mailto:amitwip@gmail.com]
> Sent: Wednesday, June 19, 2013 10:59 AM
> To: java-user@lucene.apache.org
> Subject: IndexSearcher using Collector
> 
> Hi,
> 
> I have multiple index that i want to search against, thus i am using
> MultiReader for that. Along with this I also want all the matches to the query
> so i am using Collector class for this.
> 
> The issue i am facing is that I am not able to know when all the matches are
> done, i.e. for each matching doc the collect function on the Collector class will
> be called but, when all the matches are done how can i come to know about
> that. The search function doesn't block.
> 
> Is there any way to get this done?
> 
> Thanks
> Amit


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