I want to use scripts in the way[ https://www.elastic.co/blog/running-groovy-scripts-without-dynamic-scripting ] for security purpose.
I tried this in sense
(chrome plugin) and it works well. Wondering how to achieve this in elastic4s.
For example, I want to remove a field from doc, and code like this:
def replaceWithId(alarmId: String, fieldName: String, fieldValue: Map[String, Any]) = {
client.execute {
update id alarmId in IndexType script """{"file":"removeOperationField"}"""
}}
but it failed.
You need to set the script type, rather than including it in the json explicitly, eg: