I presume you’re using TS v3, in which case, this option now belongs within the 
:sql option:

  Wall.search Sanitize.clean(@query),
    :sql => {:include => :vk_photos},
    :with => search,
    :order => ‘created_at DESC’,
    :page => params[:page],
    :per_page => 15

It’s also worth noting that :match_mode does nothing in TS v3 - extended is the 
only mode available for the SphinxQL protocol (which is what TS v3 uses).

If you’re still using TS v1 or v2, then what you’ve tried *should* work (both 
:include and :match_mode).

Hope this helps!

— 
Pat

> On 16 Sep 2015, at 8:50 am, Игорь Калашнюк <[email protected]> wrote:
> 
> Third day this software makes me crazy.
> At this moment I'm fighting with eager loading.
> As I know it should be very easy
>       @walls = Wall.search( Sanitize.clean(@query),
>                             :include => :vk_photos,    <<<<<<<<<<< this
>                             with: search,
>                             match_mode: :phrase,
>                             order: 'created_at DESC',
>                             page: params[:page],
>                             per_page: 15)
> 
> but it doesn't work.
> I've tried all
> :include => :vk_photos,
> include: :vk_photos,
> :include => [:vk_photos],
> even includeS
> 
> Оf course I have all associations
> class Wall < ActiveRecord::Base
>   ...
>   has_many :vk_photos, dependent: :destroy
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/thinking-sphinx 
> <http://groups.google.com/group/thinking-sphinx>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.

Reply via email to