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"
}
}
}
]
}
}
}
如上语句,使用javaCient实现,在本地连接线上ES库,更新成功,但在线上环境执行update返回的数量为0 ;一摸一样的代码环境也一样,从日志中获取的参数组装成的语句如上,都能执行成功, 就是在线上执行时update 返回0 ,ES版本为7.4请大神指点!!!
{
"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"
}
}
}
]
}
}
}
如上语句,使用javaCient实现,在本地连接线上ES库,更新成功,但在线上环境执行update返回的数量为0 ;一摸一样的代码环境也一样,从日志中获取的参数组装成的语句如上,都能执行成功, 就是在线上执行时update 返回0 ,ES版本为7.4请大神指点!!!
0 个回复