问题
我正在为我的 Rails 3.2.8 Web 应用程序使用 Sphinx Search (2.0.8),使用 gem Thinking Sphinx (3.0.4,直接来自 GitHub 上的分支 master)。最近,当我尝试搜索任何内容时,出现以下错误:
index group_core,project_core,user_core: query error: no field 'sphinx_internal_class_name' found in schema
在网上,我找到的建议是运行 a rake ts:rebuild
,我这样做了,但错误仍然出现。
代码
我的thinking_sphinx.yml文件如下:
development:
morphology: stem_en
enable_star: true
charset_table: "0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F"
test:
morphology: stem_en
enable_star: true
charset_table: "0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F"
production:
morphology: stem_en
enable_star: true
charset_table: "0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F"
我的索引文件在 app>indices 下,它们如下:
group_index.rb
ThinkingSphinx::Index.define :group, :with => :active_record do
indexes :name, :sortable => true
indexes :description, :sortable => true
#has post_id, user_id, created_at, updated_at
set_property :delta => true
end
用户索引.rb
ThinkingSphinx::Index.define :user, :with => :active_record do
indexes :last, :sortable => true
indexes :first, :sortable => true
indexes :preferredname, :sortable => true
indexes :email, :sortable => true
#has post_id, user_id, created_at, updated_at
set_property :delta => true
end
项目索引.rb
ThinkingSphinx::Index.define :project, :with => :active_record do
indexes :name, :sortable => true
indexes :pitch, :sortable => true
#has post_id, user_id, created_at, updated_at
set_property :delta => true
end
我在网上搜索过,但没有找到(重建索引、升级到最新版本的 Thinking Sphinx 等)解决了这个问题。有任何想法吗?