Avi, I may be confused, as I understand it you said you were interested in the last document indexed, Berhnard's code does that. Lucene adds documents sequentially, so counting backwards from the maxDoc() should get you the last indexed document pretty quickly. If all documents were deleted, then this would go through all documents, otherwise, it is going to find it pretty quickly. It doesn't have to traverse through all of the documents, it just has to find the "first" document that is not deleted (since we are starting at the end of the list and going backward)
>>> [EMAIL PROTECTED] 8/25/2004 12:01:50 PM >>> On Aug 25, 2004, at 11:57 AM, Grant Ingersoll wrote: > You are right, in the worst case, this would be linear, No, in _all_ cases this would be linear. > I would bet, that on average, > arguably nearly all cases, you would go through very few iterations > before finding the doc you are interested in Then you don't understand what I'm trying to do. I'm trying to find the document with the biggest value for the field. That would involve checking the field's value in every document to ensure this. Avi -- Avi 'rlwimi' Drissman [EMAIL PROTECTED] Argh! This darn mail server is trunca --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
