2

I have a really strange issue, since i have my thinking sphinx app giving me this error everytime i try to use search method. But i know, and i know it for sure that it USED TO work properly. i pushed it, working version on github, and left it on my computer. Then, after couple of weeks i returned but its no longer working, giving me error above. i have read similar SO topics, but they are not really giving me any helpful answer. And yes, i am completely sure mysql server is up and running

thinking_sphinx.yml

development:
  enable_star: true
  min_prefix_len: 1

database.yml:

development:
  adapter: mysql2
  encoding: utf8
  database: wyszukiwarka
  pool: 5
  username: root
  host: 127.0.0.1

test:
  adapter: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5
  timeout: 5000

in case anybody would like to take a look, here's this (previously working) app on my github account. Shame on me because commits are not in english, but the whole thing is very simple, one view and stuff: https://github.com/Sphaerus/wyszukiwarka

Leo
  • 2,061
  • 4
  • 30
  • 58

1 Answers1

1

I've run into this before and this worked for me. Try running.

rake ts:restart

And then restart your mysql.server

NM Pennypacker
  • 6,704
  • 11
  • 36
  • 38
  • it gave me: searchd is not currently running. Stopped searchd daemon (pid: 17155). Failed to start searchd daemon. Check /Users/Kuba/Desktop/Rails/wyszukiwarka/log/development.searchd.log. Failed to start searchd. Check the log files for more information. – Leo Oct 31 '13 at 13:24
  • What version of Sphinx are you running? Also, can you post what you're getting from the logs? – NM Pennypacker Oct 31 '13 at 13:28
  • actually i just tried to run rake ts:index (dont ask why, just a hunch) and the restart and it worked. still, i have no idea what was wrong and it would be really cool if somebody could explain, pat maybe, if you read this, gotham needs you – Leo Oct 31 '13 at 13:30
  • 3
    It's a bit hard to tell in retrospect, but it seems either the configuration file was incorrect (or missing), or the index files were incorrect (or missing). The daemon certainly wasn't running - hence the Mysql2::Error (which in TS 3.0.6 onwards is now wrapped in a ThinkingSphinx::ConnectionError). Hence, ts:index to fix configuration/index files, then ts:start or ts:restart to get the daemon up and running again. – pat Oct 31 '13 at 21:39