Thinking Sphinx - no indexes found in configuration file

Trying to use the thinking sphinx to search. After that, this Railscast with homebrew installing TS and MySQL (although I use pg in my application, this seems to be required), adding these lines to my gemfile:

gem 'mysql2'
gem 'thinking-sphinx'

and putting the following in my model, below everything else

post.rb

class Post < ActiveRecord::Base
    #...

    define_index do 
      indexes content
      indexes :name
    end
end

Then I go into the terminal and try to use rake ts: index, but I get this error:

 using config file '/Users/<personal>/rails_projects/<personal>/config/development.sphinx.conf'...
    FATAL: no indexes found in config file '/Users/<personal>/rails_projects/<personal>/config/development.sphinx.conf'

Fished on the Internet and did not find anything that completely answered this. I tried running rake ts: configure (which does not complain) and then rake ts: index, but it does not work.

: ( zsh), . , , . . , , , .

:

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
}

, / ?

. Q & A Google, rails "Post.sphinx_indexes. ", . , - ?

NoMethodError: undefined method `define_index' for #<Class:0x007f9c06c611b0>
        from /Users/<personal>/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/dynamic_matchers.rb:55:in `method_missing'
        from /Users/<personal>/rails_projects/<personal>/app/models/post.rb:55:in `<class:Post>'
        from /Users/<personal>/rails_projects/<personal>/app/models/post.rb:13:in `<top (required)>'
        from /Users/<personal>/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:469:in `load'
        from /Users/<personal>/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:469:in `block in load_file'
        from /Users/<personal>/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:639:in `new_constants_in'
        from /Users/<personal>/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:468:in `load_file'
        from /Users/<personal>/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:353:in `require_or_load'
        from /Users/<personal>/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:502:in `load_missing_constant'
        from /Users/<personal>/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:192:in `block in const_missing'
        from /Users/<personal>/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:190:in `each'
        from /Users/<personal>/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:190:in `const_missing'
        from (irb):1
        from /Users/<personal>/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in `start'
        from /Users/<personal>/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in `start'
        from /Users/<personal>/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:41:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'irb(main):002:0> 
+5
2

Google Thinking Sphinx Google , . , , , - , , , - .

:

, . , Sphinx v2, v3 - , ( ). app/index - README - ( , , , ): https://github.com/pat/thinking-sphinx/blob/master/README.textile

, , . , :)

- Pat

, , -, , Sphinx PostgreSQL.

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

, Sphinx (think_sphinx mysql2), brew Sphinx mysql pgsql, .

, rake ts: index .

+5

. , "i", , , .

, yonks, ...

[ !]

+2
source

All Articles