Hi David I'd recommend having an index on the Comment model as well, and then doing a search across both models: ThinkingSphinx.search 'query'
This way, you'll know exactly which comment instances match. (There's no way to find this out from Sphinx in your current setup). -- Pat On 08/09/2009, at 7:03 PM, David wrote: > > I have a models Article and Comments, where Articles have many > Comments. How can I get Thinking Sphinx to return the list of Articles > which have Comments containing my search term, and also return a list > of the matching Comments in that Article, without doing multiple > searches? I currently have... > > For Articles: > indexes :name, :as => :article_name > indexes comments.body, :as => :comment_body > > Is there a way to determine which comments the 'comments.body' > attribute matches? Any help would be appreciated. Thanks. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
