You could also look at the FieldSelector when getting the Document. Such that you only load the one field you need

-Grant

On Feb 26, 2008, at 10:13 PM, Mark Miller wrote:

The Lucene prime directive: dont iterate through all of Hits! Its horribly inefficient. You must use a hitcollector. Even still, getting your field values will be slow no matter what if you get for every hit. You don't want to do this for every hit in a search. But don't loop through Hits.

fangz wrote:
Thank you for the info.  It makes sense.
My search will return more than 10000 documents and I have to loop through all documents to build a list with unique field values. It seems that the looping of the hits takes the longest time in the initial run but afterwards it becomes much faster. If the hits are relatively small, I do not see the
same behavior.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------
Grant Ingersoll
http://www.lucenebootcamp.com
Next Training: April 7, 2008 at ApacheCon Europe in Amsterdam

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to