Hello I'm new to painless language, and I don't understand how to exactly to write an if condition.
I want to show the value 1 or 0 in my visualization but the if statement I wrote doesn't seem to work.
It looks like you are combining an if statement with a ternary -- try removing if and see if your script works.
Inline scripts allow you to define the script in your request directly. The alternative is using stored scripts, and simply referring to them by id in your request. This means you'd be using the _scripts APIs to store the actual script, and then you only need to reference that id elsewhere (and pass params as needed).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.