Rails、searchkick (Elasticsearch 2.3) 补全提示错误

Rails, searchkick (Elasticsearch 2.3) completion suggester error

我在应用程序中使用旧版 ES 2.3 和 searchkick 2.5 版本。

在模型中定义了自定义映射。

mappings: {
  my_model: {
    properties: { 
      ...
      suggestion: { type: "completion", analyzer: "ru_RU", search_analyzer: "ru_RU" }
    }
  }
}

def search_data
  {
    ...
    suggestion: suggestions
  }
end

# a custom method on the model to fill suggestions
def suggestions
 ['some', 'suggestions'] # an array 
end

当我尝试重新索引模型时,出现 Mixing up field types: class org.elasticsearch.index.mapper.core.StringFieldMapper$StringFieldType != class org.elasticsearch.index.mapper.core.CompletionFieldMapper$CompletionFieldType on field suggestion 错误。

我做错了什么? 非常感谢解决此问题的任何帮助。

将ES版本升级到2.4解决