Try 'has' instead of 'indexes':
has "COUNT(belongings.id)", :as => :viewer_count
You don't need :sortable - attributes are sortable by Sphinx without needing
any special settings.
--
Pat
On 23/02/2010, at 3:50 PM, spiceee wrote:
>
> Hey, before I crack open the TS code and start debugging, this used to
> work a few versions back:
>
> define_index do
> indexes name, :sortable => true
> indexes created_at, :sortable => true
> has belongings(:id), :as => :belongings_ids
> indexes "COUNT(belongings.id)", :as => :viewer_count, :sortable =>
> true
> set_property :delta => true
> end
>
> sphinx_scope(:by_most_views) do
> {:order => "viewer_count DESC, @relevance DESC"}
> end
>
>> Model.by_most_views.search("something").each {|m| puts
> m.belongings.size}
> 6
> 4
> 32
> 23
> 2097
> 15
>
> Does anything sound a bit off?
>
> Thanks,
>
> Spe.
>
> --
> 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.
>
--
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.