> Från: Karl Wettin [mailto:[EMAIL PROTECTED] > 28 aug 2007 kl. 17.48 skrev Per Lindberg: > > > Now, I want to search the content, and return only the > > LATEST found document with each id. To complicate > > things a bit, I want the latest before a given date. In other > > words, for each id pick only the one with the highest date > > less than x. > > Given you added documents with version time stamp in chronological > order, how about using a RangeQuery and pick the hit with the > greatest document number?
Yep, that did the trick! There seems to be no Filter that can do the final picking of the highest date, so I had to do that after the search. I use IndexSearcher.search with a RangeFilter, I presume that's just as efficient as a RangeQuery? Thanks! Per --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]