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 Fri, 09 Apr 2004 19:30:35 GMT
On Apr 9, 2004, at 3:18 PM, lucene@nitwit.de wrote:
> I implemented a VLH pattern Lucene's search hits but noticed that 
> hits.doc()
> is quite slow (3000+ hits took about 500ms).
>
> So, I want to ask people here for a solution. I tought about something 
> like a
> wrapper for the VO (value/transfer object), i.e. that the VO does not
> actually contain the value but a reference to lucene's Hits instance. 
> But
> this somewhat a hack...
>
> Any ideas?

This is an interesting architecture question.  If you are trying to 
decouple things so much that you want to package up all documents in 
another data structure and ship them to another tier, you're asking for 
a heap of resources for a large Hits collection.

Do you really need *all* documents from Hits?  If not, then you should 
not be pulling them all with hits.doc().

If you truly do need all hits, use a HitCollector instead of Hits (see 
the other search() methods).

Packaging up a Hits instance could be problematic - you need to be sure 
the *same* IndexSearcher is around when you start navigating through 
the hits.

	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