On Fri, May 18, 2007 at 07:53:39PM +0200, Jon Druse wrote:
>
> > 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").
>
>
> maybe i'm just a total noob, but where can i put this?
>
> here's my search mothod ...
>
>
> @results = Record.multi_search(params[:search_terms], [ Link, Post
> ], {:limit => :all})
the :sort option belongs to the same hash as :limit.
here's a sample from the aaf unit tests:
sorting = [ Ferret::Search::SortField.new(:id) ]
result = Content.multi_search('*:title OR *:comment',
[Comment],
:sort => sorting)
note that I don't use the Sort class at all, an Array of SortFields is
ok.
Jens
--
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[EMAIL PROTECTED] | www.webit.de
Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk