2012-03-12 10 views
3

アプリケーションはRails 2.3.12とThinkingSphinx 1.4.11を使用しています。製品モデルには1つのインデックスしかなく、develボックスで正常に動作しています。 cap staging deploy後、私は、サーバー上の設定を生成するインデックスを作成し、デーモンを起動しています:Sphinx Daemonがエラーを返しました:index product_core:INTERNAL ERROR:着信スキーマが一致しません。ステージングサーバ上でのみ

bundle exec rake ts:conf RAILS_ENV=staging 
bundle exec rake ts:index RAILS_ENV=staging 
bundle exec rake ts:start RAILS_ENV=staging 

コンソールをレールに行くの後、私は取得しています:もちろん

>> Product.search('music') 
Sphinx Sphinx Daemon returned error: index product_core: INTERNAL ERROR: incoming-  schema mismatch (in=uint account_id:[email protected], my=uint account_id:[email protected]) 
ThinkingSphinx::SphinxError: index product_core: INTERNAL ERROR: incoming-schema mismatch (in=uint account_id:[email protected], my=uint account_id:[email protected]) 
from /var/www/rebelshop_staging/rebelshop/shared/bundle/ruby/1.8/gems/thinking-sphinx-1.4.11/lib/thinking_sphinx/search.rb:417:in `populate' 
from /var/www/rebelshop_staging/rebelshop/shared/bundle/ruby/1.8/gems/thinking-sphinx-1.4.11/lib/thinking_sphinx/search.rb:562:in `call' 
from /var/www/rebelshop_staging/rebelshop/shared/bundle/ruby/1.8/gems/thinking-sphinx-1.4.11/lib/thinking_sphinx/search.rb:562:in `retry_on_stale_index' 
from /var/www/rebelshop_staging/rebelshop/shared/bundle/ruby/1.8/gems/thinking-sphinx-1.4.11/lib/thinking_sphinx/search.rb:404:in `populate' 
from /var/www/rebelshop_staging/rebelshop/shared/bundle/ruby/1.8/gems/thinking-sphinx-1.4.11/lib/thinking_sphinx/search.rb:167:in `method_missing' 
from /usr/local/lib/ruby/1.8/irb.rb:310:in `output_value' 
from /usr/local/lib/ruby/1.8/irb.rb:159:in `eval_input' 
from /usr/local/lib/ruby/1.8/irb.rb:271:in `signal_status' 
from /usr/local/lib/ruby/1.8/irb.rb:155:in `eval_input' 
from /usr/local/lib/ruby/1.8/irb.rb:154:in `eval_input' 
from /usr/local/lib/ruby/1.8/irb.rb:71:in `start' 
from /usr/local/lib/ruby/1.8/irb.rb:70:in `catch' 
from /usr/local/lib/ruby/1.8/irb.rb:70:in `start' 
from /usr/local/bin/irb:13 

を私がした後、このようなインデックスを生成することを知っています各cap staging deployは最適ではなく、カピストラノステージング構成(共有セクション、リンクなど)で解決する必要がありますが、今は手動で作業したいと思っています。

答えて

3

私は同じエラーを受けました。同じフィールドに対して2回、インデックスとして、もう1回、属性として2つのインデックスを作成していたためです。

Thinking Sphinxの構文は通常のsphinx.confの構文とはかなり異なるため、非常に混乱する可能性があります。通常のsphinx.confでは、通常のフィールドを作成しなければなりません。また、重み付けのためにCRC32整数と同じフィールドを作成する必要があります。

Thinking Sphinxではこれを行う必要はありません。 I上記ACCOUNT_IDの場合

がエラー、したがって、あなたはそれを二度作成している推測している、あなただけのモデルのdefine_indexブロックに一度、それを作成する必要があります。

has account_id 

それとも、ACCOUNT_IDを必要とする場合何か他のもののためのフィールド、スフィンクス属性に別のエイリアスを作成します。

indexes account_id 
has account_id, :type => :integer, :as => :account_id_attribute 

それはすでに整数だ場合:type => :integerは必要ありませんが、計量の目的のために一つに非整数フィールドを回すことができるので、私はそれを左に、 examplのためにe:

has "CRC32(media)", :type => :integer, :as => :media 
+0

ありがとうございます。私はそれを解決することができたが、それはずっと前だったので、原因が何かを覚えていない。それは私の古い仕事だったので、私はそれを確認するためにレポにアクセスする必要はありません。とにかく、あなたの有益な答えは、他の人が同様の問題を扱うのに役立つかもしれません。 –

+0

保存しました!ありがとうございました。 – grilix

関連する問題