elasticsearch - 根映射定义在运行弹性搜索无痛脚本时具有不受支持的参数(mapper_parsing_exception)
问题描述
{
"query": {
"match_all": {}
},
"script": {
"source":"if(ctx._source.containsKey('priority')){if (ctx._source.priority != null && ctx._source.priority != 'null') { ctx._source.priority_filter = String.valueOf(ctx._source.priority) } else { ctx._source.priority_filter = ''}}",
"lang": "painless"
}
}
当我尝试运行上述脚本时出现以下错误,谁能告诉我哪里出错了,我的弹性搜索版本是v6.5.2
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Root mapping definition has unsupported parameters: [query : {match_all={}}] [script : {source=if(ctx._source.containsKey('priority')){if (ctx._source.priority != null && ctx._source.priority != 'null') { ctx._source.priority_filter = String.valueOf(ctx._source.priority) } else { ctx._source.priority_filter = ''}}, lang=painless}]"
}
],
"type": "mapper_parsing_exception",
"reason": "Root mapping definition has unsupported parameters: [query : {match_all={}}] [script : {source=if(ctx._source.containsKey('priority')){if (ctx._source.priority != null && ctx._source.priority != 'null') { ctx._source.priority_filter = String.valueOf(ctx._source.priority) } else { ctx._source.priority_filter = ''}}, lang=painless}]"
},
"status": 400
}
解决方案
推荐阅读
- android - Mono Android 和 Xamarin.android 之间的区别
- rest - 是否建议将所有场景响应数据保存到外部文件中并在代码内部而不是功能文件中读取?
- angular - 同时添加/删除元素时列表项动画不起作用
- python - 如何通过 python 请求登录到 Iptorrents.com
- python - 在 Google Colab 中使用自定义库而不安装驱动器
- alexa - 如何让用户说出失败的话语?
- javascript - 将 React 路由组件传递给父组件 props 函数
- python - 运行 json.loads 后出现 KeyError
- python-3.x - “如何修复”AttributeError:“list”对象没有“translate”属性
- azure - 在 Azure 中启动/停止 vm 的最低权限角色