Can not get result of “script_fields” in elasticsearch

不想你离开。 提交于 2019-12-12 04:56:06

问题


I am trying to use "script_fields" in order to set new values to my fields but I can not see the "field" that I have added on result set,{

  "query": {
    "my_type_x": xxx
  },
  "script_fields": {
    "test1": {
      "script": "doc['my_type'].value * 3"
    }
  }
}

Once I launch this on elasticsearch I get no error and get the results without any problem but I can not see any "test1" with changed value.

Where do I need to review ? Can you please tell me if anything is wrong ?

Thank you


回答1:


My problem was coming from the configuration of Elasticsearch. I just added,

script.disable_dynamic: false

and it started to work.



来源:https://stackoverflow.com/questions/29105351/can-not-get-result-of-script-fields-in-elasticsearch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!