tag:support.flying-sphinx.com,2011-01-05:/discussions/problems/2145-sphinx-index-without-errors-but-it-doesnt-fetch-any-instanceFlying Sphinx: Discussion 2016-09-15T13:11:37Ztag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T11:56:30Z2016-09-15T11:56:31ZSphinx index without errors but it doesn't fetch any instance<div><p>I have an app using Flying Sphinx on Heroku. Locally, everything
works fine. However, when I deploy to production, it cannot fetch
any instance.<br>
I've added the Flying Sphinx add on and run heroku run rake
fs:index fs:configure with not results<br>
When I check in the dashboard it gives the feeling that everything
is alright.<br>
The app is called on Heroku staging-sennheiser-h-c<br>
Please, let me know which info could I provide to make it easier to
debug.</p>
<p>Thanks in advance.</p></div>Harí Carrerastag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T12:02:26Z2016-09-15T12:02:26ZSphinx index without errors but it doesn't fetch any instance<div><p>Hi Harí</p>
<p>It looks like there are no Connector, Headset or Device objects
in your database - at least, that’s what the output of the
fs:index task is saying. Is that correct?</p>
<p>Cheers</p>
<p>— Pat</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T12:22:16Z2016-09-15T12:22:16ZSphinx index without errors but it doesn't fetch any instance<div><p>Sorry, it must have been because of a new deploy.<br>
The database now contains instances of three of them. However when
indexing or rebuilding it says:<br>
skipping non-plain index 'connector'...<br>
skipping non-plain index 'device'...<br>
skipping non-plain index 'headset'...<br>
I've researched and I saw it's normal if I'm using delta
indexes.</p></div>Harí Carrerastag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T12:23:18Z2016-09-15T12:23:21ZSphinx index without errors but it doesn't fetch any instance<div><p>The error is still the same (in case I was not clear enough
:)</p></div>Harí Carrerastag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T12:23:42Z2016-09-15T12:23:42ZSphinx index without errors but it doesn't fetch any instance<div><p>It’s normal even if you’re not using deltas -
nothing to worry about at all :)</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T12:24:24Z2016-09-15T12:24:24ZSphinx index without errors but it doesn't fetch any instance<div><p>Oh, you’re still not seeing search results?</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T12:28:19Z2016-09-15T12:28:20ZSphinx index without errors but it doesn't fetch any instance<div><p>Unfortunately, not... It was the problem I had before (the empty
database was only in the moment I posted this)</p></div>Harí Carrerastag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T12:37:06Z2016-09-15T12:37:06ZSphinx index without errors but it doesn't fetch any instance<div><p>Hmm. There’s definitely data stored in your Sphinx
indices. Can you share the Ruby code of the Thinking Sphinx search
query you’re running?</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T12:45:45Z2016-09-15T12:45:46ZSphinx index without errors but it doesn't fetch any instance<div><p>Hi Pat,<br>
Thanks for answering.<br>
The code is definitely OK since it works in both development and
tests.</p>
<p>The search would be like:</p>
<p>def fetch_results Device.search(
ThinkingSphinx::Query.escape(query), page: page, per_page: per,
include: [ :connectors, :manufacturer ], with: {
sphinx_internal_id: Device.visible.pluck(:id) } ) end</p>
<p>And in my controller I call it:</p>
<p>@devices = DeviceFinder.new(params: { q: params[:term], per:
10_000 }).result</p>
<p>This calls fetch_results</p>
<p>It's running on Rails 3. I've just read your article that for
Rails 3 I should use 'flying-sphinx', '0.7.0' and I'm running
1.2.0.<br>
I'm going to try that :)</p></div>Harí Carrerastag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T12:48:22Z2016-09-15T12:48:22ZSphinx index without errors but it doesn't fetch any instance<div><p>1.2.0 should be okay with Rails 3 - certainly, I can’t
spot any issues that are related to the flying-sphinx gem.</p>
<p>Can you confirm that <code>Device.visible.pluck(:id)</code>
returns the ids you’re expecting it to? And what query values
are you testing this with?</p>
<p>— Pat</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T12:54:40Z2016-09-15T12:54:41ZSphinx index without errors but it doesn't fetch any instance<div><p>I can confirm that Device.visible.pluck(:id) returns the
expected values (around 9485)</p>
<p>I've tried with empty values (in development it returns them
correctly) and with some queries like "cisco".</p></div>Harí Carrerastag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T12:58:10Z2016-09-15T12:58:10ZSphinx index without errors but it doesn't fetch any instance<div><p>Hmm. I’m running queries directly on your Sphinx daemon
and getting results. For example, searching for cisco (without the
filter) returns 87 matches (e.g. SELECT * FROM device_core WHERE
MATCH('cisco') LIMIT 1000;)</p>
<p>Can you check in your Rails console that searches without the
filter are returning the expected results for you?</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T13:04:10Z2016-09-15T13:04:10ZSphinx index without errors but it doesn't fetch any instance<div><p>I can't believe this. I was missing an env variable.<br>
Thanks a lot for your time Pat.</p></div>Harí Carrerastag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T13:09:26Z2016-09-15T13:09:26ZSphinx index without errors but it doesn't fetch any instance<div><p>No worries, great to hear you’ve got it working now :)</p>
<p>Any further issues, do let me know! Though it’s just gone
11pm here, so I probably won’t be so prompt to reply in the
next several hours :)</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/407611902016-09-15T13:11:36Z2016-09-15T13:11:37ZSphinx index without errors but it doesn't fetch any instance<div><p>Sleep well on Wurundjeri land :)</p></div>Harí Carreras