elasticsearch 2.4.0执行update的时候发现的一个问题
请关注inline参数的变化
正确:
POST /test/type1/1/_update
{
"script" : {
"inline": "ctx._source.tags.contains(tag)?ctx.op =\"delete\":(ctx.op =\"none\")",
"params" : {
"tag" : "blue"
}
}
}
正确:
POST /test/type1/1/_update
{
"script" : {
"inline": "ctx._source.tags.contains(tag)?(ctx.op =\"delete\"):(ctx.op =\"none\")",
"params" : {
"tag" : "blue"
}
}
}
错误:
POST /test/type1/1/_update
{
"script" : {
"inline": "ctx._source.tags.contains(tag)?ctx.op =\"delete\":ctx.op =\"none\" ",
"params" : {
"tag" : "blue"
}
}
}