【发布时间】:2021-12-24 20:27:56
【问题描述】:
我对 ES 不太熟悉,所以可能我犯了一些错误。
我有一个索引users,其映射如下。
{
"mappings":{
"dynamic":false,
"properties":{
"id":{
"type":"keyword"
},
"userId":{
"type":"text"
},
"total":{
"type":"float"
},
"count":{
"type":"float"
},
"earnings":{
"properties":{
"potential":{
"properties":{
"pending":{
"type":"float"
},
"finished":{
"type":"float"
}
}
},
"completed":{
"properties":{
"pending":{
"type":"float"
},
"paid":{
"type":"float"
}
}
}
}
}
}
}
}
我想使用更新 API 更新嵌套字段,例如收益.potential.pending。我有一个类似于下面使用更新 API 的脚本。
{
"script" : {
"source": "ctx._source.earnings.potential.pending += params.total",
"lang": "painless",
"params" : {
"total" : 4
}
}
}
但是,我遇到了illegal_argument_exception,点符号是假设的问题,如下所示。
"ctx._source.earnings.potential.pending += params.total",
^---- HERE'
【问题讨论】:
标签: elasticsearch aws-elasticsearch opensearch