I have a listing model that has_many statuses:

class Listing < ActiveRecord::Base
  has_many :statuses

  define_index do
    indexes :name
    indexes :description
    indexes [:address, :city, :state, :zip], :as => :full_address
    has statuses(:id), :as => :status_ids, :type => :integer
    has "RADIANS(latitude)",  :as => :latitude,  :type => :float
    has "RADIANS(longitude)", :as => :longitude, :type => :float
    set_property(:morphology => 'stem_en')
    set_property(:ignore_chars => 'U+0027')
    set_property(:enable_star => true)
  end
end

My problem is that I get the following error while creating/rebuilding
the index:

indexing index 'listing_core'...
ERROR: index 'listing_core': sql_range_query: Column 'latitude' in
field list is ambiguous (DSN=mysql://root:*...@localhost:3306/
listings_development).

Secondly, my question is that even if I get this to work, can I order
the results based on the associations count/size and then by distance
and relevance?

The index is created just fine when I remove:

has statuses(:id), :as => :status_ids, :type => :integer

What could be going on?

--

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