Http Request from painless script not working

I want to create a runtime field based on some conditions. And i have a query which is working fine on kibana console. I implemented the same query on java code but is not working. There is a method in SearchRequest runtimeMappings() which is overloaded and can accepts String key, List<RuntimeField> value or can accepts Map<String, List<RuntimeField>> map . But when I am using any of these methods and running my query, it is throwing an exception: Caused by: org.elasticsearch.index.mapper.MapperParsingException: Expected map for runtime field [w_ticket_category] definition but got a java.util.ArrayList. This is happening because the ES expects Map instead of List in the value of these mathods. The query on kibana console taking value as a Map only and is working, and if I am trying to pass a List instead of Map then I am getting the same error.

UPDATE: I got a diff in which we can see the changes for that method. The runtimeMappings(String key, RuntimeField value) changed to runtimeMappings(String key, List<RuntimeField> value) and similarly runtimeMappings(Map<String, RuntimeField> map) changed to runtimeMappings(Map<String, List<RuntimeField>> map).
Is there any specific reason for it.
Github Diff Link
Is it known issue or i'm doing something wrong...
Any help would be appreciated.
Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.