You'll need to be more specific than "it's not working properly". Do you get an exception from elasticsearch when using that script? Why is the json requestion you are making?
Also, please blockquote code/json using triple quotes (it makes it much easier to read), eg:
There is no logging functionality in painless as that would be a big performance hit if done on a search request matching many documents. Instead, there is Debug.explain().
Since there is no exception, can you be more specific about what you are expecting from this request and what behavior you actually see?
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.