You're right! It appears the culprit is "indexes tag_taggings.tag(:name), 
as: :tags". When I remove this attribute from the index the ratings work 
perfect. Although I need the tags as part of the search...

I tried adding like you said:

has_many :positive_votes, :class_name => 'Vote', :foreign_key => 
'voteable_id', :conditions => {:vote => true}
has_many :negative_votes, :class_name => 'Vote', :foreign_key => 
'voteable_id', :conditions => {:vote => false}

define index
  has "CAST(COUNT(DISTINCT positive_votes.id) - COUNT(DISTINCT 
negative_votes.id)) as float", :as => :rating, :type => :float
  join positive_votes
  join negative_votes
end

but I keep getting an issue like:

<https://lh6.googleusercontent.com/-wsvBMQCkBh0/UMLFdUVWEII/AAAAAAAAAE4/8_MFgc_Ruso/s1600/ts-error.png>




OR

 

<https://lh4.googleusercontent.com/-d0_e-c5zgX4/UMLGuDRdJsI/AAAAAAAAAFA/yZj_1mtEwns/s1600/Screen+Shot+2012-12-07+at+11.48.29+PM.png>

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/thinking-sphinx/-/rKhgcDqmt64J.
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