lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Hogan" ...@mikehogan.net>
Subject Re: [subscriptions] Please make org.apache.lucene.index.IndexWriter non-final
Date Sun, 05 Oct 2003 21:00:13 GMT
> >             final Hits hits = searcher.search(q);
> >             numHits = hits.length();
> >             while (beginIndex <= endIndex && beginIndex < numHits)
{
> >                 final Document doc = hits.doc(beginIndex++);
> >                 collector.add(doc.get("id"));
> >             }
> 
> Another suggestion - use the HitCollector search method rather than 
> getting Hits back and then walking them.  Hits is adding a level of 
> indirection and caching that you obviously don't need here - and 
> HitCollector would streamline your code a bit here.

Cheers Erik, much appreciated.

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


Mime
View raw message