On 10/17/06, Caspar Bl <[EMAIL PROTECTED]> wrote:
> Hi I think this is a very easy question but here goes:
>
> I want to sort my results by a boolean field and then by score, I
> thought this would be a default configuration but apparently not.
>
<rearranged email>
> [this] is my current code, how do iu alter it so that the results are then
> sorted by highest score first?
>
> sort_fields = []
> sort_fields << Ferret::Search::SortField.new(:sponsored, :reverse =>
> :true)
    sort_fields << Ferret::Search::SortField::SCORE
    sort = Ferret::Search::Sort.new(sort_fields)

You can pass the array of SortFields as the :sort parameter or even a
sort string ("sponsored DESC, SCORE").

Cheers,
Dave
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to