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
Problem with scripted update - "params" are ignored #487
Comments
The body = {
script: {
source: "if (!ctx._source.containsKey(\"title_akas\")) { ctx._source.title_akas = [] } ctx._source.title_akas.add(params.aka)",
params: {
aka: { text: "New Title AKA" }
},
lang: "painless"
}
} |
@felipeelias thanks, that worked! I was following the example in the documentation that suggested that the
|
karmi
pushed a commit
that referenced
this issue
Jan 14, 2018
karmi
pushed a commit
that referenced
this issue
Jan 14, 2018
Hi @madebydna, yes, @felipeelias is right, the format has changed, but the inline documentation has not been updated. I've updated the example, it should be: client.update index: 'myindex', type: 'mytype', id: '1',
body: { script: { source: 'ctx._source.tags.add(params.tag)', params: { tag: 'x' } } } Thanks for bringing it to my attention! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to do a scripted partial update but my params are being ignored, or they are evaluated as
null
:The result of the operation is that a
null
title_akas
is added:title_akas
is a nested field in the index:The same scripted update works via the console:
The text was updated successfully, but these errors were encountered: