Searchkick Elasticsearch 抛出 400 错误

Searchkick Elasticsearch throwing a 400 error

我最近更新到 High Seirra,不确定这是否意味着什么,现在我在尝试重新索引 Active Record 模型时遇到此错误。

我尝试过的东西。我已经重新安装了 RVM、Ruby、Elasticsearch。仍然遇到相同的错误。

我团队中的其他人也进行了同样的升级,他们 运行 很好。 以下是我收到的错误。

Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_default_]: Could not convert [word_start.index] to boolean"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_default_]: Could not convert [word_start.index] to boolean","caused_by":{"type":"illegal_argument_exception","reason":"Could not convert [word_start.index] to boolean","caused_by":{"type":"illegal_argument_exception","reason":"Failed to parse value [analyzed] as only [true] or [false] are allowed."}}},"status":400}
from /Users/rrobin244/.rvm/gems/ruby-2.3.3/gems/elasticsearch-transport-5.0.4/lib/elasticsearch/transport/transport/base.rb:202:in `__raise_transport_error'

我遇到了同样的问题,我不得不在 Mac

上升级 elasticsearch
brew upgrade elasticsearch

检查您的 Gemfile.lock 并检查那里的 elasticsearch 版本。如果它与本地系统中的 elasticsearch 版本不匹配,请删除 gemfile.lock 文件和 运行 包。这解决了我的问题。