1
Elasticsearch 2.3。我发射这个查询来根据条件更新索引中的每个文档。Elasticsearch中的条件更新:“无效op [无]”
{
"query": {
"bool": {
"must": [
{
"match_all": {}
}
]
}
},
"script": {
"inline": "if (ctx._source.url.endsWith('a=6')) ctx.op = 'none' else ctx._source.url = ctx._source.url + '&b=3'"
}
}
如前所述here,我使用ctx.op = 'none'
以避免更新不符合条件的文档。
我越来越
Invalid op [none]
完整的错误:
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Invalid op [none]"
}
],
"type": "illegal_argument_exception",
"reason": "Invalid op [none]"
},
"status": 400
似乎是如此简单,我很迷失。谢谢你的帮助。
感谢。似乎现在正在工作。所以上面提到的2.3的文档在某种程度上是错误的,或者至少是不明确的。 – AitorF
文档本身没问题,只有例子是错的(旧)。 –