Normal Thinking Sphinx searches will always make a query to the database as
well - Sphinx cannot store all the information about a model instance, let
alone associated model information, hence why the database request is required.
However, you can limit the request to just the instance ids instead by using
Item.search_for_ids instead of Item.search - but given you want content and sku
objects, I'm guessing that's not the behaviour that's desired.
Cheers
--
Pat
On 03/08/2011, at 1:48 AM, zetarun wrote:
> Hi all,
> I'm using eager loading in thinking sphinx searches in the same way I
> use it for active record searches. The problem is that I don't want to
> hit the database when I run searches on Sphinx but this is not the
> behaviour of the ":include" attribute in my TS calls...
>
> For instance, this search query:
> Item.search :match_mode => :fullscan, :with => {:featured =>
> true}, :per_page => 200, :include => [:contents, :skus]
>
> Hit the database to retrieve the objects contents and skus while I
> expected to have all the object I requested by Sphinx...note that all
> the objects in the :include are indexed in the "define_index" of Item
> model.
>
> What am I doing wrong?
>
> Thank you very much!
>
> --
> 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.