-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Update by query should support short script form and doc
#24898
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
What do you mean by partial updates? |
No, I mean the
This request would merge the |
Ok, thanks for the clarification. So this would happen outside of the script itself. |
Hi, |
This is two issues:
The reasoning behind the first point is that we wanted to keep update-by-query simple. We can do it though. I don't think solving the first point would be a good first contribution, but it is a thing we can do. The second point is fine for a first contribution because it is just extra parsing without any additional changes. I don't know why it doesn't work now but to fix it I'd hunt down how we do parsing with |
Thanks, @nik9000. |
Update by Query is modified to accept short `script` parameter. Closes issue #24898
Update by Query is modified to accept short `script` parameter. Closes issue #24898
This should be closed by #26841 |
And what about the |
@nik9000 any updates on support for |
We've talked about this in the past and not been too keen on it. |
support only |
Still waiting support for doc. If you are here, you probably want to use this script: {
source: "for (k in params.keySet()) {ctx._source[k] = params[k]}",
params: {a: 1, b: 2 ...}
} |
Thanks @souenzzo! "script": {
"source": "for (k in params.keySet()) {ctx._source[k] = params[k]}",
"params": {
"obj": {
"field2": "val"
}
}
} https://www.reddit.com/r/elasticsearch/comments/upig3f/how_to_merge_objects_in_painless/ |
The
script
parameter in update-by-query requires a full script object, instead of allowing the simple script form:We should be using the same script parser we use every else, which would take care of this automatically.
Also, any reason why we don't support partial doc updates with the
doc
parameter`?The text was updated successfully, but these errors were encountered: