On Apr 9, 2004, at 3:18 PM, [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to