弹性搜索[1.5.2] update_by_query无法正常工作 [英] Elasticsearch [1.5.2] update_by_query doesn't work as expected

查看:517
本文介绍了弹性搜索[1.5.2] update_by_query无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我缺少一些基本的东西,我很乐意弹性搜索。我正在尝试更新我的索引中的文档中的一个字段。

  POST test_index / _update_by_query 
{
查询:{
match {
label:{
query:checked,
type:短语
}
}
},
script:ctx._source.status ='ok'
}

看起来它正在找到文档,只是不更新​​它们。这是奇迹的输出

  {
ok:true,
taken:7531 ,
total:230954,
updated:0,
indices:[
{
test_index:{}
}
]
}

我已经在 https://github.com/yakaz/elasticsearch-action-updatebyquery 。任何帮助将不胜感激。感谢提前 -

解决方案

最后弄清楚发生了什么。要添加另一行到.yml来使这项工作。以下是我添加到配置文件的更改:

  script.inline:true 
script.indexed:true
script.disable_dynamic:false

添加第三行有差异。感谢您的帮助意见。


I'm fairly new to Elasticsearch so apologies if I am missing something elementary. I am trying to update a field within documents in my index.

POST test_index/_update_by_query
{
  "query": {
    "match": {
      "label": {
        "query": " checked",
        "type": "phrase"
      }
    }
  },
  "script": "ctx._source.status = 'ok'"
}

Looks like it's finding the documents, just doesn't update them. Here is the output in marvel

{
   "ok": true,
   "took": 7531,
   "total": 230954,
   "updated": 0,
   "indices": [
      {
         "test_index": {}
      }
    ]
}

I've installed the plugin at https://github.com/yakaz/elasticsearch-action-updatebyquery as recommended. Any help would be most appreciated. Thanks in advance -

解决方案

Finally figured out what was going on. Had to add another line to the .yml to make this work. Here are the changes I added to the configuration file:

script.inline: true
script.indexed: true
script.disable_dynamic: false

adding the 3rd line makes the difference. thanks for the helpful comments.

这篇关于弹性搜索[1.5.2] update_by_query无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆