With the release of Elasticsearch 5.0, we can use a new scripting language that has become the default: Painless. It is a simple and secure scripting language available in Elasticsearch by default and does not require any plugin to be installed. Painless is designed specifically for use with Elasticsearch and can safely be used with inline and stored scripting, without worrying about any security issues or configuration changes.
There is not much documentation available on the Painless scripting language yet but according to the Elasticsearch official documentation, Painless syntax is similar to Groovy. Although we will cover how to use Painless with some examples in the next sections, lets first learn about the basics of Painless syntax and semantics.