ES 7.4版本使用update_by_query 修改,update = 0,请问是什么原因?
Elasticsearch | 作者 lingxiao | 发布于2020年09月24日 | 阅读数:2432
type='inline',lang='painless',连接线上环境本地环境启动更新成功,但是在线上环境,请求都是OK的但是更新数量为0,是什么原因?直接使用语句在kibana中执行也是OK的,下面是执行语句,java中组装的语句与下面语句一摸一样!
POST commodity_index_test/_update_by_query
{
"script": {
"source": "ctx._source.fTypes=params.fTypes;ctx._source.sTypes=params.sTypes;ctx._source.tTypes=params.tTypes",
"type": "inline",
"lang": "painless",
"params": {
"fTypes": [
{
"name": "测试1",
"id": "e10cdf06496841af95648f5920964329"
}
],
"sTypes": [
{
"name": "测试2",
"id": "e10cdf06496841af95648f5920964329"
}
],
"tTypes": [
{
"name": "测试3",
"id": "e10cdf06496841af95648f5920964329"
}
]
}
},
"query": {
"bool": {
"must": [
{
"term": {
"commodityId": {
"value": "1667120617927737346"
}
}
}
]
}
}
}
POST commodity_index_test/_update_by_query
{
"script": {
"source": "ctx._source.fTypes=params.fTypes;ctx._source.sTypes=params.sTypes;ctx._source.tTypes=params.tTypes",
"type": "inline",
"lang": "painless",
"params": {
"fTypes": [
{
"name": "测试1",
"id": "e10cdf06496841af95648f5920964329"
}
],
"sTypes": [
{
"name": "测试2",
"id": "e10cdf06496841af95648f5920964329"
}
],
"tTypes": [
{
"name": "测试3",
"id": "e10cdf06496841af95648f5920964329"
}
]
}
},
"query": {
"bool": {
"must": [
{
"term": {
"commodityId": {
"value": "1667120617927737346"
}
}
}
]
}
}
}
0 个回复