Would you mind posting what values are actually in the Map you're using? If the values are what you expect I may be able to add a test locally on my end to see what's going on. You may be able to use Debug.explain (https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-debugging.html) to print the contents if you haven't already.
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.