On 7/7/06, Tom Davies <[EMAIL PROTECTED]> wrote:
> I am leaning towards the first version, so all in one string.  That
> way you can have mixed sortings too such as "name ASC, created_at
> DESC".  I also agree with Jens comment that calling it :order would
> make it more rails like.

Ok, string it is. And :order I can do too, although it won't hurt to
leave :sort as an option.

> While we are at it, it would also be nice to use :limit for :num_docs,
> and :offset for :first_doc.

+1
This sounds better to me too. Anyone disagree?

> Tom
>
> On 7/7/06, Jens Kraemer <[EMAIL PROTECTED]> wrote:
> > On Fri, Jul 07, 2006 at 10:52:20PM +0900, David Balmain wrote:
> > > On 7/7/06, Tom Davies <[EMAIL PROTECTED]> wrote:
> > [..]
> > >
> > > By the way, did you already know you could do this in the current
> > > version of Ferret?:
> > >
> > >     num = INDEX.search_each(query, :sort => ['created_at', 'url']) do
> > > |doc, score|
> > >
> > > The only problem with this is that it doesn't allow you to reverse the
> > > sort. You have to do this;
> > >
> > >     url_sorter = Ferret::Search::SortField.new('url', :reverse => true)
> > >     num = INDEX.search_each(query, :sort => ['created_at',
> > > url_sorter]) do |doc, score|
> > >
> > > Maybe your sql sort string idea is a good one. Which do you think is 
> > > better?
> > >
> > >     num = INDEX.search_each(query, :sort => 'created_at, url_sorter
> > > DESC') do |doc, score|
> >
> > +1
> >
> > using :order instead of :sort would make it even more Rails-like.
> >
> > Jens
> >
> >
> > --
> > webit! Gesellschaft für neue Medien mbH          www.webit.de
> > Dipl.-Wirtschaftsingenieur Jens Krämer       [EMAIL PROTECTED]
> > Schnorrstraße 76                         Tel +49 351 46766  0
> > D-01069 Dresden                          Fax +49 351 46766 66
> > _______________________________________________
> > Ferret-talk mailing list
> > [email protected]
> > http://rubyforge.org/mailman/listinfo/ferret-talk
> >
>
>
> --
> Tom Davies
>
> http://atomgiant.com
> http://gifthat.com
> _______________________________________________
> Ferret-talk mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/ferret-talk
>
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to