ThinkingSphinx connection error
Hi. I upgrade my project from rails 4 to rails 5 and ThinkingSphinx stopped working.
I get error when try to searching:
ThinkingSphinx::ConnectionError (Error connecting to Sphinx via the MySQL protocol. Can't connect to MySQL server on '127.0.0.1' (111))
Gem versions: gem 'flying-sphinx', '2.0'
gem 'mysql2', '~> 0.4.10'
gem 'thinking-sphinx', '~> 4.3'
Config thinking_sphynx.yml
production:
version: 3.1.1 morphology: stem_en indexed_models: - Title After deploy i execute bundle exec rake ts:rebuild
Thanks!
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac
1 Posted by Sergey Pozhidae... on 24 Jul, 2019 11:43 AM
I check Sphinx daemon - is loading
Support Staff 2 Posted by Pat Allan on 24 Jul, 2019 12:13 PM
Hi Sergey,
I’m not sure if it’s related, but can you try updating the flying-sphinx gem to the latest release (v2.1.4), and confirm thinking-sphinx is using 4.3.2?
Support Staff 3 Posted by Pat Allan on 24 Jul, 2019 12:18 PM
Hi Sergey,
Just looking at the gem releases, there was actually a bug fix in flying-sphinx v2.1.4 to ensure it works well with thinking-sphinx v4.2+, so I suspect that’s the problem, and upgrading the two gems to their latest releases will indeed fix the issue.
Do let me know if that’s not the case, though!
Kind regards,
—
Pat
4 Posted by Sergey Pozhidae... on 25 Jul, 2019 06:36 AM
I have an error after gems update:
ThinkingSphinx::SphinxError (no enabled local indexes to search)
Support Staff 5 Posted by Pat Allan on 25 Jul, 2019 06:38 AM
Hi Sergey,
Can you confirm the name of your app so I can investigate more thoroughly?
Cheers,
—
Pat
6 Posted by Sergey Pozhidae... on 25 Jul, 2019 06:41 AM
Flying Sphinx log
7 Posted by Sergey Pozhidae... on 25 Jul, 2019 06:45 AM
My app name is stark-cloud-2613-pr-37
Thanks!
Support Staff 8 Posted by Pat Allan on 25 Jul, 2019 06:48 AM
There seems to be an odd error during the indexing… I’m not yet sure what the cause is, but I’ll keep investigating and let you know what I find.
Support Staff 9 Posted by Pat Allan on 25 Jul, 2019 07:02 AM
Okay, it looks like a bug in Sphinx v3.1.1.
http://sphinxsearch.com/forum/view.html?id=16081
Thinking Sphinx configures Sphinx to only request 1024 records at a time, but it does that by min/max id values. e.g. 1-1024, then 1025-2048, 2049-3072, etc. If one of those min/max windows actually returns no records, this error occurs.
http://sphinxsearch.com/docs/current.html#conf-sql-range-step
You’ve got a few options to work around this…
set_property :disable_range? => truein your index definition.set_property :sql_range_step => 100_000or similar. Depending on how many gaps are in your primary key values, you may still hit the bug!I recommend the first option, unless you know you’re only going to be dealing with small amounts of data (and then disabling the ranged queries is okay). It's a shame this bug exists, but hopefully there's a fixed release of Sphinx at some point soon.
10 Posted by Sergey Pozhidae... on 25 Jul, 2019 07:18 AM
Great! It works. Thank you very much
Support Staff 11 Posted by Pat Allan on 25 Jul, 2019 07:19 AM
No worries :)
Pat Allan closed this discussion on 25 Jul, 2019 07:19 AM.