lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Why I can not interrupt the search?
Date Wed, 05 Jun 2013 11:52:57 GMT
Have you seen TimeLimitingCollector?

Best
Erick

On Wed, Jun 5, 2013 at 6:39 AM, 朱彦安 <shaco.zhu@gmail.com> wrote:
> Hello!
>
> In the search hit a lot,I want to hit the 2000 docs return data immediately.
>
> I can not find such a method of lucene.
>
> I have tried:
>
> public int score(Collector collector,int max){
>
> collector.setScorer(this);
>
> int doc;
>
> int count;
>
> while((doc = nextDoc())!= NO_MORE_DOCS){
>
> ++count;
>
> collector.collect(doc);
>
> if(count >=max){break;}
>
> }
>
> }
>
> Can I do this?

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


Mime
View raw message