Just for clarity it will sort them descending order for expression
sorting.  Re-reading my reply I was ambiguous :)

On Apr 4, 9:31 pm, Pat Allan <[email protected]> wrote:
> Hi Tom
>
> I think you're out of luck with combining sort types - Sphinx only  
> accepts one or the other. And reading over the documentation, I'd say  
> you're right in assuming DESC is the default (it doesn't say, but  
> higher values indicate better matching, I think).
>
> Cheers
>
> --
> Pat
>
> On 05/04/2009, at 11:28 AM, Tom Davies wrote:
>
>
>
> > Thanks Pat.  :sort_by works.  I don't think the docs make reference to
> > that anywhere or at least not to the :expr usage.
>
> > Also, do you know if there is a way to specify both expression and
> > SPH_SORT_EXTENDED type sorting, like:
>
> > :sort_by => "@weight+1, price ASC"
>
> > And I could not get ASC or DESC to work for :expr based sort so I am
> > guessing it always sorts DESC.  Do you know if that is the case?  The
> > sphinx search docs don't seem to cover this.
>
> > Thanks,
> > Tom
>
> > On Apr 3, 1:04 am, Pat Allan <[email protected]> wrote:
> >> Sorry, that was a little terse, let me elaborate.
>
> >> :order is an ActiveRecord option - and so to make things easier, I
> >> translate it across to :sort_by (the Sphinx equivalent), with some
> >> smarts to ensure sorting for fields works, etc. It seems like it's  
> >> not
> >> clever enough, if it's not working in your situation. I'll look  
> >> into it.
>
> >> Cheers
>
> >> --
> >> Pat
>
> >> On 03/04/2009, at 4:02 PM, Pat Allan wrote:
>
> >>> Try :sort_by instead of :order - although it would be nice if it
> >>> worked as you stated.
>
> >>> --
> >>> Pat
>
> >>> On 03/04/2009, at 1:18 AM, Tom Davies wrote:
>
> >>>> I was trying to play around with expression based sorting but  
> >>>> having
> >>>> no luck (sphinx returns no results so I must be doing something
> >>>> wrong).  I tried something like:
>
> >>>> :sort_mode => :expr, :order => "@weight+1"
>
> >>>> just as a simple test.  If anyone has a simple working example you
> >>>> could share I would appreciate it.
>
> >>>> Thanks,
> >>>> Tom
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to