Sure: has address.state_id, :as => :state_id You can drill down through associations as deep as you like - just make sure you give it an explicit name using :as.
-- Pat On 23/03/2010, at 8:31 PM, nnn wrote: > I watch peepcode-security, released by peepcode.com, the pdf has a > cheapter talk about filter search. a code like this: > > class Contact > belongs_to :state > > so that filter doing this way: > > define_index do > #existed code here > has state_id > end > > quite simple, just added -has state_id-. my question is what about not > direct association? > > put into a reality case, my association is contact.address.state. I > have a address as bridge. like this, Can I filter state? > > -- > 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. > -- 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.
