Sorting Boolean fields

Hey there,

I came across this thread: http://www.ruby-forum.com/topic/78148#126235
where sorting in reverse by a boolean field wasn’t working properly. I’m
having the same issue now, but there’s not a reply in that thread. I was
wondering if anyone has figured this out yet?

Bascially, I want all the records with a “1” (true) to float to the top
of the results.

Thanks!

On 9/19/06, Michael L. [email protected] wrote:

Thanks!
Hi Michael,

See the documentation for Ferret::Search::Sort and
Ferret::Search::SortField:

http://ferret.davebalmain.com/api/

Alternatively you can just pass a sort string like this:

hits = index.search(query, :sort => "boolean_field DESC, title")

Cheers,
Dave