【ELK】elasticsearch中使用腳本報錯:scripts of type [inline], operation [update] and lang [groovy] are disabled


 

查看ID為2的這條數據:

 

 

使用更新命令:

使用腳本對年齡+5

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

 

報錯:

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

 

 

解決方法:

 在es的conf目錄下的 elasticsearch.yml 文件添加如下配置:

 script.inline: on
 script.indexed: on

 

之后重啟,再重試該命令

 

 

執行成功:

查看

 

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

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM