Hi Andrew The only way to get custom joins in currently is to change the generated SQL query, and then run rake ts:reindex (instead of index) - as that won't overwrite the file. Obviously, every time you make changes elsewhere, you *will* want to overwrite the file.
So, maybe duplicate association definitions is the way to go - named_scopes in define_index would be pretty complex to figure out, but you're welcome to patch if you want ;) Cheers -- Pat On 28/02/2010, at 6:28 PM, Andrew France wrote: > Hi, > > Is there currently any way to specify join constraints outside of the > association definition? I ask because I have has_many associations > which should be ignored by the search under certain conditions but > they don't belong on the association. At the moment the only solution > I can think of is to duplicate the associations just for the indexer. > I tried adding where conditions but that has resulted in disappearing > records as the filtering is of course done post-join. > > I was thinking it could be achieved by allowing named_scopes to be > used in the define_index block the same way as associations are > drilled-down. It seems like it would be a substantial rewrite of the > association code to achieve this? > > Any help appreciated. > > Best regards, > Andrew > > -- > 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.
