Hi again,

I managed to solve the problem. Apparently the :middleware option does not
work when searching in a specific model, but does work for the
ThinkingSphinx.search() call (and you can use :classes)

If anyone else has the same problem, here's how you can use RAW_ONLY:

    results = ThinkingSphinx.search('keyword', :classes=>[MyModel],
:middleware=>ThinkingSphinx::Middleware::RAW_ONLY)
    results.each{|o| puts o}


-Timo



On 26 September 2013 10:57, Timo Virkkala <[email protected]> wrote:

> Hi Pat (and others),
>
> In ThinkingSphinx v2 I could do something like this:
>
>     MyModel.search('keyword', :only=>[:attr1, :attr2])
>
> This would get me results as a hash directly from the index, skipping the
> database access ActiveRecord loading altogether. However, apparently the
> option :only does not work in Thinking Sphinx v3.
>
> Does some similar functionality exist in v3? Or would I have to write my
> own middleware for that? I tried to look at the middlewares, but I couldn't
> figure out how to get the results when I use the RAW_ONLY stack.
>
>
> -Timo
>

-- 
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/groups/opt_out.

Reply via email to