Update Api script and Scripting in Elastic search

Hi,
I am trying to use the update api of elasticsearch. In that i can use the script tag to update fields like counter.
Now my concern is it is said that by default dynamic scripting is off and i dont want to get into any security issues, so can i still use the update api or do i need to turn on the dynamic scripting in it?

elastic search version : 2.3

You can write a groovy script file and put it on your nodes as explained here: https://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-scripting.html#modules-scripting

And in 5.0 the default language for scripts (painless) is fully sandboxed and enabled by default.