On 13/09/2007, at 2:36 PM, Adrian Sutton wrote:
I think you can use the CollapseFilter to collapse on "version"
field.
However, I think you need to modify the CollapseFilter code to
sort by
"version" and get the latest version returned.
Ooo, that's very cool. I assume the patches haven't actually been
applied yet? This would let me just collapse on the name field and
if I could get it to sort by modification date before collapsing
it'd be perfect.
I have a feeling I'm going to wind up extremely lost, but I'll
delve into the patch and see what I can find.
For the benefit of the archives (and anyone else following along), it
looks like the current version of the patch in JIRA will actually do
what I need. The collapse filter will return the first N documents it
iterates over and collapse the rest, but before iterating it will
sort the documents by the sort parameters you specify. So to get the
latest version I simply set sort=version,desc.
It seems to work well, though the patch needs to be updated again to
work with HEAD, it's not too hard to resolve the differences.
Regards,
Adrian Sutton.
http://www.symphonious.net/