【发布时间】:2020-04-30 15:57:26
【问题描述】:
这是我尝试过的:
POST orders/_update_by_query
{
"script" : "ctx._source.geoip += newElement",
"params": {
"newElement": {
"location" : "[40.730610, -73.935242]"
}
},
"query": {
"term": {
"CITY": {
"value": "nyc"
}
}
}
}
上面会抛出错误[params] 中 START_OBJECT 的未知键。
第二次尝试:
POST orders/_update_by_query
{
"script":{
"source":
"for (item in ctx._source.geoip){item.location = '[40.730610, -73.935242]'}",
"lang":"painless"
},
"query": {
"term": {
"CITY": {
"value": "nyc"
}
}
}
}
上面抛出空指针异常,指向source.geoip处的句点
我也尝试将 location 的值更改为只是 test 但收到相同的错误。
这是我的映射:
{
"orders" : {
"mappings" : {
"properties" : {
"geoip" : {
"dynamic" : "true",
"properties" : {
"location" : {
"type" : "geo_point"
}
}
}
}
}
我正在使用 ES v7.2 和 Kibana v7.2
【问题讨论】:
标签: elasticsearch geolocation kibana elasticsearch-painless