我是新来的ElasticSearch堆栈。。。每当我试图在kibana开发工具控制台中执行下面的查询时,总是会遇到下面提到的错误
在kibana控制台中执行的查询
POST employees-details/_update_by_query
{
"query": {
"match": {
"EmpName": "Arvind"
}
},
"script": {
"source": "ctx._source.Address.add(params.tag)",
"lang": "painless",
"params": {
"tag":{
"AddressID":144,
"AddressNumber":458
}
}
}
}
不断得到这个错误 \/
执行上述查询时^^
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "dynamic method [java.util.HashMap, add/1] not found"
}
样本数据
[
{
"_index" : "employees-details",
"_type" : "_doc",
"_id" : "101",
"_score" : 1.0,
"_source" : {
"EmpUserID" : 101,
"Gender" : "Male",
"EmpName" : "John",
"Age" : 35
}
},
{
"_index" : "employees-details",
"_type" : "_doc",
"_id" : "106",
"_score" : 1.0,
"_source" : {
"EmpUserID" : 106,
"Address" : {
"AddressNumber" : 201,
"AddressID" : 200
},
"Gender" : "Male",
"EmpName" : "Arvind",
"Age" : 30
}
}
]
使用的版本
kibana:7.9.3ElasticSearch:7.9.3
提前感谢:)
1条答案
按热度按时间o75abkj41#
自
Address
是散列,不能使用add()
方法(用于数组、列表等集合)。相反,你需要改变Address
先到名单上然后打电话add()
: