Помогите понять причину ошибки Illegal list shortcut value
Ошибка
{
"error": {
"root_cause": [
{
"type": "script_exception",
"reason": "runtime error",
"script_stack": [
"ctx._source.user.contact.id = 5;",
" ^---- HERE"
],
"script": "ctx._source.user.contact.id = 5;",
"lang": "painless"
}
],
"type": "script_exception",
"reason": "runtime error",
"script_stack": [
"ctx._source.user.contact.id = 5;",
" ^---- HERE"
],
"script": "ctx._source.user.contact.id = 5;",
"lang": "painless",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "Illegal list shortcut value [contact]."
}
},
"status": 500
}
Индекс
PUT my_index
{
"mappings": {
"doc": {
"properties": {
"user": {
"type": "nested",
"properties": {
"contact": {
"properties": {
"id": {
"type": "integer"
}
}
}
}
}
}
}
}
}
Документ
PUT my_index/doc/1
{
"user" : [
{
"contact" : {
"id" : 1
}
}
]
}
Поиск и обновление
POST my_index/_update_by_query
{
"script": {
"lang": "painless",
"source": "ctx._source.user.contact.id = 5;"
},
"query": {
"nested": {
"path": "user",
"ignore_unmapped": true,
"query": {
"terms": {
"user.contact.id": [
1
]
}
}
}
}
}