4

Possible Duplicate:
Problem running Thinking Sphinx with Rails 2.3.5

I'm running rails 2.3.5 Every time I run rake ts:start or ts.rebuild the rake file quite with the following:

Sphinx cannot be found on your system. You may need to configure the following
settings in your config/sphinx.yml file:
  * bin_path
  * searchd_binary_name
  * indexer_binary_name

rake aborted!
key not found

I have Sphinx running and the sphinx.yml in config is correct:(I believe)

bin_path: /usr/bin/searchd
  searchd_binary_name: searchd
  indexer_binary_name: sphinx-indexer

Sphinx seems to be running, as when it is running ( by running command: service searchd start)

The error I get when I browse to a page that uses search is:

ThinkingSphinx::SphinxError in Jobs#index
 Showing app/views/jobs/index.html.erb where line #30 raised:
 unknown local index 'job_core' in search request

Rather than a connection error? Probably a multitude of problems here but i"m stuck. Alternatively, I could rewrite the code I'm amending to use a different search function, if so, what's best?

Community
  • 1
  • 1
Tom
  • 170
  • 1
  • 8

2 Answers2

1

bin_path should not include the actual binary names (as you're setting them with searchd_binary_name and indexer_binary_name) - so try it with just /usr/bin.

pat
  • 16,116
  • 5
  • 40
  • 46
  • Tried that with no luck. No idea what's wrong with the setup but I'm reluctantly going to use conditions on my mysql statements with %like% conditions. – Tom Aug 21 '11 at 12:02
  • 1
    Tom, if you want to try this again - you have indexed your data before starting the daemon, yes? `rake ts:index` – pat Aug 22 '11 at 01:30
1

Comparing your sphinx.yml config to mine, it looks like my values for bin_path, search_binary_name and index_binary_name are expressed as strings, but that doesn't seem to matter. My indexer binary however is indexer rather than sphinx-indexer

development:
    min_infix_len: 3
    config_file: "./config/development.sphinx.conf"
    searchd_log_file: "./log/searchd.log"
    query_log_file: "./log/searchd.query.log"
    pid_file: "./log/searchd.development.pid"
    bin_path: "/usr/local/bin"
    searchd_binary_name: "searchd"
    indexer_binary_name: "indexer" 

So it maybe worth just checking you've specified the correct binary names. This is in addition to what Pat said re not including the search binary name in the bin_path.

ste
  • 401
  • 3
  • 5