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