Haseeb Ahmad
Haseeb Ahmad

Reputation: 8730

How to include associations in thinking sphinx rails

Using thinking-sphinx to fetch records and it works fine. But the issue is that I want to fetch associated records also in results to improve site performance.

Like I want to fetch pictures of articles also along with articles .

Tried this one but its not working

 Article.search :include => [:pictures]

How can I do that?

Upvotes: 0

Views: 93

Answers (1)

pat
pat

Reputation: 16226

Since Thinking Sphinx v3, the :include option is now within the :sql option:

Article.search :sql => {:include => :pictures}

Upvotes: 1

Related Questions