I've upgraded Elastic search from "2.3.4" to "7.10.0". I wanna upgrade existing code of getting mapping for a specific index and type. Please refer below code(old and new).
old code(2.3.4):
Map<String, Object> mappingMeta = client.admin().indices().prepareGetMappings("index1").get().mappings().get("index1").get("type1").getSourceAsMap();
new code(7.10.0):
GetMappingsRequest mappingsRequest = new GetMappingsRequest();
mappingsRequest.indices("index1");
GetMappingsResponse mappingsResponse = client.indices().getMapping(mappingsRequest, RequestOptions.DEFAULT);
Map<String, Object> mappingMeta = mappingsResponse.mappings().get("index1").getSourceAsMap();
In new code changes, i can get mappings only for an index. How to get mappings for a type("type1" in old code) in ES 7.10.0?