思维狮身人面像中的图式不匹配

时间:2012-02-22 06:35:21

标签: ruby-on-rails sphinx thinking-sphinx

我在思考sphinx

    define_index do
        indexes to
        indexes created_on
        has created_on
    end

现在在控制台上搜索

    Emaildumps.search 5.day.ago,
    :group_by => 'created_on',
    :group_function => :day

现在我得到的错误是

     Sphinx Daemon returned error: index emaildumps_core: INTERNAL ERROR: incoming-schema mismatch (in=timestamp created_on:32@160, my=timestamp created_on:32@0)

这可能是一个愚蠢的问题,但我是狮身人面像的新手,我无法理解索引和搜索的基本原理

我做错了什么?

所以请帮帮我。

1 个答案:

答案 0 :(得分:7)

它可能是相关的,但你不能拥有同名的字段和属性。所以,我建议别名其中一个(字段更好):

define_index do
  indexes to
  indexes created_on, :as => :created_on_field
  has created_on
end

那就是说,不确定create_on作为一个字段是否有很多价值,但取决于你。

相关问题