Model: Product
has-many product-categories, :through => ...
Question 1) How do I index a many to many association with thinking sphinx
Must I use has?
Questions 2) How is this searched in the controller
ex. Product.search params[:search-params], :conditions => {some_conditions}
I’ve not tried this on a has_many :through so shoot me down in flames if you have, but I don’t see why this wouldn’t work for you too, (I’m using it on a has_many association) you basically use your association in the index definition. Then searches against that model will also search the child records.
In the controller:
In the view:
If you don’t already have it I would highly recommend the thinking-sphinx book available on peepcode: https://peepcode.com/products/thinking-sphinx-pdf
Hope that helps.