Hi Martin

The problem is you're requesting comments_count be treated as a  
string, and then translated to an integer. Try the following instead:

   has comments_count, :as => :comments

That should do the trick. You don't need the :sortable - attributes  
(as opposed to fields) are always sortable by Sphinx.

Cheers

-- 
Pat

On 11/03/2009, at 12:37 AM, Martin wrote:

>
> Hi
> I like to order a search request by an integer field. But when I do so
> the order (comments_count) is 1, 11, 2 and not 1, 2, 11. How can I
> define the index that the field can be ordered like an integer and not
> a string?
>
> My articles model right now:
> define_index do
>  indexes title, :sortable => true
>  indexes comments_count, :as => :comments, :sortable => true
> end
>
> >


--~--~---------~--~----~------------~-------~--~----~
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