Hi Pat,

I'm using Rails 3.2 and Thinking Sphinx 3. I have the following associated 
models:

> # country.rbclass Country < ActiveRecord::Base
>   has_many :statesend
> # state.rbclass State < ActiveRecord::Base
>   belongs_to :country
>   has_many :state_shops
>   has_many :shops, :through => :state_shopsend
> # state_shop.rbclass StateShop < ActiveRecord::Base
>   belongs_to :state
>   belongs_to :shopend
> # shop.rbclass Shop < ActiveRecord::Base    end
>
>  

In *country.rb*, I wanna search the name of *shop*. Here is my index for *
country*:

> # country_index.rbThinkingSphinx::Index.define :country, :with => 
> :active_record do
>   indexes :name
>
>   has budget, duration, overall_rating, created_atend
>
>
I'm not sure if this helps as a reference: in my other controller I would 
do this to get *countries* based on the *shop.id*:

@countries = Country.joins(:states => [ :state_shops => :shop 
> ]).where("shops.id" => @shop.id).group("countries.id")
>
 

How should my associated index be in order to search the *shop.name*? 
Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to