Have you seen TimeLimitingCollector? Best Erick
On Wed, Jun 5, 2013 at 6:39 AM, 朱彦安 <shaco....@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-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org