Reputation: 631
I know to the below command is enough throught REST
get _all/_mapping
but how to do in java using elastic search api?
Upvotes: 1
Views: 225
Reputation: 217274
You can do this simply with the indices admin client like this:
GetMappingsResponse response = client()
.admin()
.indices()
.prepareGetMappings()
.execute()
.actionGet();
ImmutableOpenMap<String, ImmutableOpenMap<String, MappingMetaData>> mappings = response.getMappings();
...
Upvotes: 1