On Friday 09 April 2004 21:18, [EMAIL PROTECTED] wrote: > Hi! > > 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...
Lucene's Hits already wraps quite a bit. Under the hoods it will redo your search in case you need more than 100 results. Hits was designed for displaying a few web pages of search results. When you need 3000 hits and their stored fields, you might consider using the lower level search API with your own HitCollector. This will allow you to do a single search, and retrieve the stored document fields in order of document number after the search. Documents are stored physically in document number order, so retrieval in that order is normally close to optimal. Actual savings depend a lot on the circumstances, though. I checked the VLH pattern very briefly. The lower level search API of Lucene seems to fit in quite well for the retrieval side of it, ie. the DataAccessObject, for a larger number of results. However, you'll have to throw some more RAM than Hits does at the difference between the physical order of Lucene and the order in which the client needs to iterate the data. Kind regards, Ype --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]