Re: [ts] FATAL: no indexes found in config file

440 views
Skip to first unread message

Pat Allan

unread,
Mar 6, 2013, 3:04:17 AM3/6/13
to thinkin...@googlegroups.com
Hi Sasha

The issue is that Thinking Sphinx's documentation is mostly for v2, but v3 is what you're using (and much better). Index definitions are now located in app/indices - the README is your best source of information (but anything it doesn't cover is probably the same as earlier versions):
https://github.com/pat/thinking-sphinx/blob/master/README.textile

Have a read through of that, move your index definition, and you should be good to go. Any further issues, get in touch :)

--
Pat

On 06/03/2013, at 6:12 PM, Sasha Klein wrote:

> Hi,
>
> Just installed Thinking Sphinx for my Rails app and have run into the above error. Opened a Stack Overflow post about it, but it doesn't seem to be getting many views/answers. I'll leave the bulk of my code there, where I think it's easier to comb through, but just reiterate the basic problem here.
>
> I installed TS and MySQL (already runny development and production on postgresql), then defined indexes for my post model, and went to run "rake ts:index" per the instructions on this Railscast, but I got the error in the subject line.
>
> I searched for solutions and ran into this other similar post, but it seems like we have different root causes, as the result of running "Post.sphinx_indexes.length" in the console shows. At any rate, all of this code and some more background is visible in the SO post.
>
> Any ideas what's going on? If you'd rather I post the code here, I can do that as well. Just felt redundant.
>
> --
> 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 thinking-sphi...@googlegroups.com.
> To post to this group, send email to thinkin...@googlegroups.com.
> Visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



Sasha Klein

unread,
Mar 7, 2013, 2:30:54 AM3/7/13
to thinkin...@googlegroups.com
Thanks!

Ran into another error once I cleared that one :)

So I moved my index definition and tried running "rake ts:index" again, and got this error:

indexing index 'post_core'...
ERROR: source 'post_core_0': unknown type 'pgsql'; skipping.
ERROR: index 'post_core': failed to configure some of the sources, will not index.
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg

Looking around, I saw this was possibly fixed by creating a config/sphinx.yml file and putting:

development:
  bin_path: '/usr/local/bin'
develpment:
  bin_path: '/usr/local/bin'

in it. Ran that and it still didn't work. Then tried "rake ts:configure", and it ran smoothly but still referred to the same config/development.sphinx.conf file, which is now a good deal more full:

indexer
{
}

searchd
{
  listen = 127.0.0.1:9306:mysql41
  log = /Users/<personal>/rails_projects/<personal>/log/development.searchd.log
  query_log = /Users/<personal>/rails_projects/<personal>/log/development.searchd.query.log
  pid_file = /Users/<personal>/rails_projects/<personal>/log/development.sphinx.pid
  workers = threads
  binlog_path = /Users/<personal>/rails_projects/<personal>/tmp/binlog/development
}

source post_core_0
{
  type = pgsql
  sql_host = localhost
  sql_user = <personal>
  sql_pass = 
  sql_db = <personal>_development
  sql_query = SELECT "posts"."id" * 1 + 0 AS "id", 'Post' AS "sphinx_internal_class_name", "posts"."name" AS "name", "posts"."content" AS "content", "posts"."id" AS "sphinx_internal_id", 'Post' AS "sphinx_internal_class", 0 AS "sphinx_deleted" FROM "posts"  WHERE ("posts"."id" >= $start AND "posts"."id" <= $end) GROUP BY "posts"."id", "posts"."name", "posts"."content", "posts"."id"
  sql_query_range = SELECT COALESCE(MIN("posts"."id"), 1), COALESCE(MAX("posts"."id"), 1) FROM "posts" 
  sql_attr_uint = sphinx_internal_id
  sql_attr_uint = sphinx_deleted
  sql_attr_string = sphinx_internal_class
  sql_query_info = SELECT "posts".* FROM "posts"  WHERE ("posts"."id" = ($id - 0) / 1)
}

index post_core
{
  path = /Users/<personal>/rails_projects/<personal>/db/sphinx/development/post_core
  docinfo = extern
  charset_type = utf-8
  source = post_core_0
}

Any ideas what's happening now? Thanks, and sorry for all the questions.

Pat Allan

unread,
Mar 7, 2013, 5:22:42 AM3/7/13
to thinkin...@googlegroups.com
Hi Sasha

No worries about asking questions - especially since I think I can answer this one :)

It looks like Sphinx on your machine was compiled without support for PostgreSQL. How did you install PostgreSQL? And how did you install Sphinx? If you compiled by hand, Sphinx doesn't automatically add PostgreSQL support - you need to set it with a flag (it's annoying, because I use PostgreSQL all the time too). It's mentioned in the UNIX section of the TS docs briefly:
http://pat.github.com/ts/en/installing_sphinx.html

From your file paths, I'm guessing you're on OS X - if you installed Sphinx via homebrew, but PostgreSQL from elsewhere (say, Heroku's Postgres.app), then you may need to provide some flags then as well to make sure homebrew detects PostgreSQL successfully.

Cheers

Pat

Sasha Klein

unread,
Mar 7, 2013, 4:06:52 PM3/7/13
to thinkin...@googlegroups.com
Thanks, Pat! Got it to work!

Sasha Klein

unread,
Mar 8, 2013, 3:38:04 AM3/8/13
to thinkin...@googlegroups.com
Ahhh! ONE more question. It was working great, then I got this error when I pushed to heroku (upon running heroku run rake ts:index -- the page with the search doesn't load):

Generating configuration to /app/config/production.sphinx.conf
Connecting to database specified by DATABASE_URL
rake aborted!
Riddle::Configuration::ConfigurationError
/app/vendor/bundle/ruby/1.9.1/gems/riddle-1.5.5/lib/riddle/configuration/searchd.rb:24:in `render'
/app/vendor/bundle/ruby/1.9.1/gems/riddle-1.5.5/lib/riddle/configuration.rb:37:in `render'
/app/vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-3.0.0/lib/thinking_sphinx/configuration.rb:81:in `render'
/app/vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-3.0.0/lib/thinking_sphinx/configuration.rb:87:in `block in render_to_file'
/app/vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-3.0.0/lib/thinking_sphinx/configuration.rb:87:in `open'
/app/vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-3.0.0/lib/thinking_sphinx/configuration.rb:87:in `render_to_file'
/app/vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-3.0.0/lib/thinking_sphinx/rake_interface.rb:4:in `configure'
/app/vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-3.0.0/lib/thinking_sphinx/rake_interface.rb:31:in `index'
/app/vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-3.0.0/lib/thinking_sphinx/tasks.rb:9:in `block (2 levels) in <top (required)>'


You received this message because you are subscribed to a topic in the Google Groups "Thinking Sphinx" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/thinking-sphinx/BTgd3_cGF-0/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to thinking-sphi...@googlegroups.com.

Pat Allan

unread,
Mar 9, 2013, 9:51:35 AM3/9/13
to thinkin...@googlegroups.com
This is because Sphinx cannot run on Heroku directly - which is why I created the add-on Flying Sphinx :)
http://flying-sphinx.com/docs

Yes, it's not free - each customer needs a decent amount of memory for their Sphinx daemon, so offering free plans is just not viable I'm afraid.

--
Pat

Reply all
Reply to author
Forward
0 new messages