-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Stored fields are getting deleted on partial update of the document. #98189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I got a bad feeling about this and took the liberty of reproducing it. The (excellent, thank you @kiljag) reproduction instructions worked exactly as described, Edit: I'm not sure exactly what to tag this - document updates are a bit in an overlapping area - but I'm going to ping appropriate folks internally. |
Pinging @elastic/es-search (Team:Search) |
Update to the above: I think I got mixed up in my testing. The behavior IS as described but is IS NOT a regression (at least from recent versions). |
Hi @gwbrown, Thanks for coming back on this. |
After getting some feedback internally, this is apparently expected and documented behavior - see this docs page. That said, I don't think this is a very intuitive way for this to work and would like to see it change. However, we also don't have a concrete proposal for what it should do instead. Since we don't have enough here to really propose a fix, I'm going to close this issue, but I would be open to a new one proposing a different behavior. |
I think the stored field should be retained after the document is updated because the updated characters are not those of _source. The result should remain unchanged |
I also have such a scenario. I only want to update some frequently changing fields. Most of these fields are of numerical type. I have closed the source of text-type data. After only updating the numerical fields, the index of text type is affected. I think this is incorrect. If full document coverage is required, the update cost is too high. |
Thanks very much for your interest in Elasticsearch @S-Dragon0302. This appears to be a user question, and we'd like to direct these kinds of things to the Elasticsearch forum. If you can stop by there, we'd appreciate it. This allows us to use GitHub for verified bug reports, feature requests, and pull requests. There's an active community in the forum that should be able to help get an answer to your question. |
Elasticsearch Version
Version: 8.9.0
Installed Plugins
No response
Java Version
openjdk 17.0.8 2023-07-18
OS Version
Linux ip-172-31-15-10 ...aws #44~20.04.1-Ubuntu SMP Thu Jun 22 12:21:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Problem Description
I have an index created using a template where few fields are excluded from _source, but stored as stored fields by setting "store" to true. But when I try to update (partial update) the document, existing stored fields are getting deleted.
Steps to Reproduce
At this point, everything is as expected.
GET itf_test_index/_search
{
"_source": [""],
"stored_fields": [""]
}
"hits": [
{
"_index": "itf_test_index",
"_id": "1",
"_score": 1,
"_source": {
"imageName": "123.jpg",
"attribute_1": "Cat"
},
"fields": {
"metric_1": [
"metric_1"
]
}
}
]
Now, previously stored "inference_1" field is not available anymore. Is this the expected behaviour and am I missing something in template creation of updating the document ?
Thank you.
Logs (if relevant)
No response
The text was updated successfully, but these errors were encountered: