elasticsearch - ElasticSearch:升级 Chewy/ElasticSearch 版本时出错
问题描述
我一直在我的 rails 应用程序中使用 gem咀嚼,在 ElasticSearch 中创建索引和搜索。之前我用的是elasticsearch 5.6版本,现在想升级到7.7。当我尝试创建索引时,出现以下错误。我正在使用的升级版耐嚼5.1.0
Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [country : {value={}}] [city : {value={}}] [state : {value={}}]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [country : {value={}}] [city : {value={}}] [state : {value={}}]","caused_by":{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [country : {value={}}] [city : {value={}}] [state : {value={}}]"}},"status":400}
但是,它在 5.6 中运行得非常好。我试图在耐嚼中找到任何更改日志,但找不到任何更改日志。请帮助我了解问题出在哪里。谢谢
解决方案
正如 Elastic Search Ninja 所建议的那样,这是由于在最新版本的 elasticsearch 中删除了类型。
截至今天(2020 年 10 月 19 日),Chewy 不支持 7.x 或 6.x
参考: https ://github.com/toptal/chewy/issues/609和 https://github.com/toptal/chewy/issues/673
推荐使用 ES 官方的 ruby 或 rails 标准包。 https://github.com/elastic/elasticsearch-ruby或 https://github.com/elastic/elasticsearch-rails
推荐阅读
- python-3.x - 如何使用维基百科 API 获取位置查询的人口(国家或州/省和/或县)?
- node.js - 在 foreach 循环中返回带有异步查询的文档
- python - 重启树莓派后 SQLite 数据丢失
- python - 从枚举中返回无
- ssh - 无法通过 SSH 隧道连接到远程 AzureDB 服务器
- scala - 如何使用较小案例类的所有属性实例化 Scala 案例类?
- javascript - 如何更改 angular-google-charts 仪表图的针颜色?
- javascript - 尝试导入错误:运行 ionic serve 时未从“ionicons/icons”导出“reorder”
- javascript - 即使从 svg 路径中删除了样式,SVG Jquery 填充也不起作用
- python - 在本地 python 虚拟环境上运行 google colab