Sphinx查询错误没有找到任何字段

时间:2012-02-09 07:25:51

标签: ruby-on-rails thinking-sphinx

我正在写这个

Network.search :conditions=>{:kind=>'Interest'}

我收到此错误

 Sphinx  Sphinx Daemon returned error: index network_core: query error: no field 'kind' found in schema

模型中的我的代码是

  define_index do
    indexes [name, description], as: :keyword
    has kind, state
  end

我已经运行了rake ts:index和rake ts:start

1 个答案:

答案 0 :(得分:2)

您的索引应如下所示:

define_index do
  indexes [name, description], as: :keyword
  indexes kind
  has state
end

此次运行后bundle exec rake ts:rebuild