Rails 3アプリ用にマウンテンライオンにスフィンクスと思考スフィンクス(3.0.2)をインストールしましたが、インストール中にすべてが正常に動作しているようです。私の最終的な計画は、スフィンクスのジオディスト機能を使用することですが、現時点では、すべてがうまく機能していることを確認したいだけです.
私のモデル - story.rb には、文字列型の title という列があります。したがって、app/indices に、以下を含むファイル story_index.rb を作成しました。
ThinkingSphinx::Index.define :story, :with => :active_record do
indexes title
end
Myrake ts:rebuild
は以下を生成します。
Stopped searchd daemon (pid: 3185).
Generating configuration to /Users/kevin/Desktop/Development/grumpy/config/development.sphinx.conf
Sphinx 2.0.9-release (r3832)
Copyright (c) 2001-2013, Andrew Aksyonoff
Copyright (c) 2008-2013, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/Users/kevin/Desktop/Development/grumpy/config/development.sphinx.conf'...
indexing index 'story_core'...
collected 2 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 2 docs, 36 bytes
total 0.016 sec, 2189 bytes/sec, 121.63 docs/sec
total 3 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 9 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
Started searchd successfully (pid: 3222).
これは問題ないようです。ただし、Rails コンソールを起動して試してみると、次のようになります。
1.9.3-p327 :001 > Story.search "dinosaur"
(Object doesn't support #inspect)
=>
DB への接続は良好で、検索基準に適合するレコードがいくつかあります。どんなアイデアや解決策も大歓迎です。:)
** GemFile で更新 **
gem 'jquery-rails', '2.0.2'
gem 'bootstrap-sass', '2.0.0'
gem 'devise', '2.1.2'
gem 'gon', '3.0.5'
gem 'resque', :require => 'resque/server'
gem 'resque-scheduler', :require => 'resque_scheduler'
gem 'thinking-sphinx', '3.0.2'
gem 'kaminari', '0.14.1'