使用Scripted Metric Aggregation进行聚合时,出现以下错误提示:
nested: QueryParsingException[[my_index] script_score the script could not be loaded]; nested: ScriptException[scripts of type [inline], operation [search] and lang [groovy] are disabled]; .
解决办法, 修改配置文件,启用groovy, 在重启
# tail -n 10 /etc/elasticsearch/elasticsearch.yml
# http server. With this enabled, it may pose a security risk, so disabling
# it unless you need it is recommended (it is disabled by default).
#
#http.jsonp.enable: true
script.groovy.sandbox.enabled: true
script.inline: on
script.indexed: on
script.search: on
script.engine.groovy.inline.aggs: on
# /etc/rc.d/init.d/elasticsearch restart
Stopping elasticsearch: [ OK ]
Starting elasticsearch: [ OK ]
nested: QueryParsingException[[my_index] script_score the script could not be loaded]; nested: ScriptException[scripts of type [inline], operation [search] and lang [groovy] are disabled]; .
解决办法, 修改配置文件,启用groovy, 在重启
# tail -n 10 /etc/elasticsearch/elasticsearch.yml
# http server. With this enabled, it may pose a security risk, so disabling
# it unless you need it is recommended (it is disabled by default).
#
#http.jsonp.enable: true
script.groovy.sandbox.enabled: true
script.inline: on
script.indexed: on
script.search: on
script.engine.groovy.inline.aggs: on
# /etc/rc.d/init.d/elasticsearch restart
Stopping elasticsearch: [ OK ]
Starting elasticsearch: [ OK ]
本文介绍了解决Elasticsearch中使用ScriptedMetricAggregation时遇到的Groovy脚本加载失败问题的方法。通过修改配置文件启用Groovy并重启服务来解决此问题。
2287

被折叠的 条评论
为什么被折叠?



