In a painless script how do I iterate through document keys based on a pattern?

@gthang

Have you tried iterating over the doc map? https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-field-context.html

Someone working through a similar problem - Loop over a map in Painless