Elasticsearch Java api client get index mapping in a Map

I have two qestion
1- I want to get mapping of an Index in a map as "Map<String, Object>", i successfully get the GetMappingResponse but from there not getting what to do in order to get mapping as a "Map<String, Object>",

GetMappingResponse mappingResponse =  getElasticsearchClient().indices().getMapping(getMappingRequestBuilder-> getMappingRequestBuilder.index("indexname"));

2, if i have "JsonData" that contains mapping , how can i get "Map<String, Object>", from it ?

Hi @ijaxahmed

with code below you have access to the map of property.

Map<String, Property> map = getMappingResponse.get("indexname").mappings().properties();

Thank you @RabBit_BR for that , But i am specifically looking for Map of Object like this "Map<String, Object>", because I have another "Map<String, Object>" from a mapping json file and i want to compare both for differences.Actually I want to compare mapping of index with another mapping file

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