I have two models Merchant/Articles with teh following define index
define_index do
indexes user.username, :as => :author
indexes subject, :as => :subject
indexes content, :as => :content
indexes article_category.category_name, :as
=> :article_category, :facet => true
indexes city, :as => :article_city, :facet => true
has created_at, updated_at
has article_category_id, :as => :article_category_id
has user(:id), :as => :author
has 'RADIANS(lat)', :as => :lat, :type => :float
has 'RADIANS(lng)',:as => :lng, :type => :float
set_property :latitude_attr => "lat"
set_property :longitude_attr => "lng"
end
define_index do
indexes :name, :sortable => true
indexes merchant_category.category_name, :as
=> :category, :facet => true
indexes :description, :as => :description
indexes :city, :as => :city, :facet => true
indexes :state, :as => :state
indexes :country, :as => :country
has created_at, updated_at
# has :city, :as => :merchant_city
has 'RADIANS(lat)', :as => :lat, :type => :float
has 'RADIANS(lng)',:as => :lng, :type => :floats
set_property :latitude_attr => "lat"
set_property :longitude_attr => "lng"
end
When I do this search, I am expecting to see results from Article
model where the city is "xxx", but I see results from Merchant model
too. Why is that?
result1 = ThinkingSphinx.facets "lorem", :all_facets =>
true, :conditions => {:article_city => "xxx"}, :facets => [:Article]
--
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.