I have a problem when trying to overwrite value of field of object type in ES document. I use update request with the following document:
{
"uid": "911e50cf-7ff6-48e2-999c-313490a0748e",
"name": "name1",
"category": ["cat1", "cat2"],
"embeddedModel": {
"modelOne": {
"terms": {
"tags": {
"2959": "tag-1",
"2956": "tag-2"
}
}
}
}
}
Then, I want to update the document with following:
{
"uid": "911e50cf-7ff6-48e2-999c-313490a0748e",
"name": "name1",
"category": ["cat1"],
"embeddedModel": {
"modelOne": {
"terms": {
"tags": {
"2959": "tag-1"
}
}
}
}
}
The only difference is in tags object and category array. As a result I expected to have only one tag in tags object but there are still two tags as in my first request. It seems that it works this way only for object types while for arrays (like "category" array") and simple types (like "name" field) it works correctly and overwrite the value instead of appending values to it.
I know that I can use index request instead of update request but I want to avoid it because I want to change only a small part of the document while the rest of it remains unchanged. Is it some kind of bug? My Elasticsearch version is 7.10.0.