lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: ValueListHandler pattern with Lucene
Date Sat, 10 Apr 2004 18:40:02 GMT
On Apr 10, 2004, at 5:08 AM, lucene@nitwit.de wrote:
> On Friday 09 April 2004 23:59, Ype Kingma wrote:
>> When you need 3000 hits and their stored fields, you might
>> consider using the lower level search API with your own HitCollector.
>
> I apologize for the stupid question but ... where's the actualy result 
> in
> HitCollector? :-)
>
>   collect(int doc, float score)
>
> Where doc is the index and score is its score - and where's the 
> Document?

Thats the beauty.... it is up to you to load the doc iff you want it.  
In many situations, loading the doc would slow things down 
dramatically.  For example, QueryFilter uses a HitCollector internally, 
but could care less about the actual document object, just its id 
(which you get from the int doc).  To get the doc:

	 Document document = searcher.doc(doc);

(I'd use 'id' for the int, personally).

	Erik


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


Mime
View raw message