lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: How to extract Document object after the search?
Date Mon, 02 Feb 2009 12:14:53 GMT
Hi


That quote is from the javadoc for
HitCollector/TopDocCollector.collect().  You missed out the bit saying
"This is called in an inner search loop".

If, as your subject implies, you want to get at the Document object
AFTER the search, those methods are fine.  Just don't use them for any
more documents than you need, and not inside the collect() method.

If you really need to get at document data inside the inner search
loop I think you'll have to accept the performance hit or look into
advanced stuff like payloads.


--
Ian.



On Mon, Feb 2, 2009 at 11:54 AM, mittals
<sourabh-931.mittal@morganstanley.com> wrote:
>
> As per Lucene documentation -
> "For good search performance, implementations of this method should not call
> Searcher.doc(int) or IndexReader.document(int) on every document number
> encountered. Doing so can slow searches by an order of magnitude or more."
>
> My question is - what's the other way to get the Document object to avoid
> performance bottleneck?
>

---------------------------------------------------------------------
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