Skip to content
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

No option for updating field using string #53

Open
BhupenPal opened this issue Jan 24, 2022 · 2 comments
Open

No option for updating field using string #53

BhupenPal opened this issue Jan 24, 2022 · 2 comments

Comments

@BhupenPal
Copy link

BhupenPal commented Jan 24, 2022

I was trying to update a document with help of a script but didn't find a way through which we can do this.

The same queries in kibana work as expected. But whenever I add a script in app-search API it just adds another field named "script" and adds the script in a stringified format as its value.

@JasonStoltz
Copy link
Member

Can you post an example or something? I don't think I understand what you're asking.

@BhupenPal
Copy link
Author

Elastic Search provides this functionality out of the box, to update or get documents by running some script on the documents while querying.

POST test/_update/1
{
"script" : {
"source": "ctx._source.counter += params.count",
"lang": "painless",
"params" : {
"count" : 4
}
}
}

I am able to perform the above query using Elastic Search API's, but I am specifically using Elastic App Search and it also provides API which has different endpoints than ElasticSearch App. But the script isn't working when I use App Search Endpoints.

This WORKS: https://imgur.com/a/0QLhAPZ
This DOESN'T: https://imgur.com/a/WbtX58E

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants