On Fri, May 18, 2007 at 08:56:07PM +0200, Jon Druse wrote:
> Jens Kraemer wrote:
> > On Fri, May 18, 2007 at 07:53:39PM +0200, Jon Druse wrote:
> >> 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.
>
>
> sorry i'm so lame... i though we were sorting by score? my results
> don't seem to change when i put that in there. :-)
my fault, I just cut'n'pasted the code from the test.
replace the
sorting = ...
line with:
sorting = [ Ferret::Search::SortField::SCORE ]
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