Hi Robbie
Seems something’s going pear shaped with the query - at least, in the console.
Generally, the “Object doesn’t support #inspect” message is because there’s
been an issue translating Sphinx results into ActiveRecord results. To get a
more helpful error message, can you run the same command with `.to_a` on the
end of it, and let us know what the stack trace is?
@results = ThinkingSphinx.search('microsoft', :classes => [Story, Feature,
Post], :per_page => 10, :page => 1).to_a
Cheers
—
Pat
> On 5 May 2015, at 5:19 pm, Robbie Shepherd <[email protected]> wrote:
>
> I'm on Heroku, using:
>
> gem 'flying-sphinx', '1.2.0'
> gem 'thinking-sphinx', '~> 3.1.0'
>
> When I conduct a search using:
> @results = ThinkingSphinx.search(params[:query], :classes => [Story, Feature,
> Post], :per_page => 10, :page => params[:page])
>
> some search terms ("bikini") work fine every time, others ("microsoft") fail
> every time, with the following error in my view:
> ActionView::Template::Error (undefined method `unscoped' for Object:Class):
>
> on this line:
>
> = pluralize(@results.total_entries, "results")
>
>
> If I run the same query in the heroku rails console, I get a slightly
> different error:
>
> irb(main):001:0> @results = ThinkingSphinx.search('microsoft', :classes =>
> [Story, Feature, Post], :per_page => 10, :page => 1)
> Sphinx Query (33.7ms) SELECT * FROM `feature_core`, `feature_delta`,
> `post_core`, `post_delta`, `story_core`, `story_delta` WHERE
> MATCH('microsoft') AND `sphinx_deleted` = 0 LIMIT 0, 10
> Sphinx Found 100 results
> (Object doesn't support #inspect)
> =>
>
>
> When I run these queries locally on my dev machine, not using flying sphinx,
> I can't replicate the issue at all. HALP!
>
> --
> 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.