【ELK】elasticsearch中使用脚本报错:scripts of type [inline], operation [update] and lang [groovy] are disable

 

查看ID为2的这条数据:curl

 

 

使用更新命令:elasticsearch

使用脚本对年龄+5url

curl -XPOST http://192.168.6.16:9200/my_new_index/user/2/_update?pretty -d '{"script" : "ctx._source.age += 5"}'

 

报错:spa

"reason" : "scripts of type [inline], operation [update] and lang [groovy] are disabled"

 

 

解决方法:code

 在es的conf目录下的 elasticsearch.yml 文件添加以下配置:blog

 script.inline: on
 script.indexed: on

 

以后重启,再重试该命令ip

 

 

执行成功:io

查看ast

 

curl -XGET http://192.168.6.16:9200/my_new_index/user/2?pretty

 

相关文章
相关标签/搜索