Forum: Ferret Reverse sorts by score

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Pedro =?ISO-8859-1?Q?C=F4rte-Real?= (Guest)
on 2006-05-09 13:15
(Received via mailing list)
The docs for Sort.new say:

reverse: pass true if you want the sort order to be reversed. Only works
if you pass the field names.

Does this mean it's not possible to do a reverse sort by score? If it is
it seems to be broken as I don't seem to be able to reverse the order of
the sort. I'll write a test case if this is not a known problem.

Greetings,

Pedro.
David B. (Guest)
on 2006-05-09 13:43
(Received via mailing list)
Hi Pedro,

To sort reverse by score do this;

    s = Sort.new(SortField.new("Reverse Score",
                         {:sort_type => SortField::SortType::SCORE,
                           :reverse => true}))

Hope that helps.

Dave
This topic is locked and can not be replied to.