elasticsearch批量脚本不能与elasticsearch.yml更改一起使用

时间:2016-03-23 16:50:12

标签: elasticsearch elasticsearch-bulk-api

当我尝试运行像:

这样的curl命令时
curl -s -XPOST localhost:9200/_bulk --data-binary "@bulk_prova.elastic"; echo

bulk_prova.elastic为:

{ "update" : {"_id" : "1", "_type" : "type1", "_index" : "indexName"} }{ "script" : "ctx._source.topic = \"topicValue\""}

我收到了这个错误

{"took":19872,"errors":true,"items":[{"update":{"_index":"indexName","_type":"type1","_id":"1","status":400,"error":{"type":"illegal_argument_exception","reason":"failed to execute script","caused_by":{"type":"script_exception","reason":"scripts of type [inline], operation [update] and lang [groovy] are disabled"}}}}]}

我搜索解决了这个问题,并且我已经管理了elasticsearch.yml文件以启用动态脚本,但每次我尝试更改文件并在重新启动elasticsearch服务时停止弹性它都无法启动。

由于这种奇怪的行为,我不知道如何解决这个问题。

我有2.2.0版本,我的目的是在索引(现在)或多于索引(一旦问题解决)中添加一个字段

1 个答案:

答案 0 :(得分:1)

在Elasticsearch 2.3中,它已被修改为:

script.disable_dynamic:false

TO:

script.file:true script.indexed:true