It can be a little confusing learning how to export elasticsearch mappings for a specific index. Exporting mappings is a great idea, just like you’d export and keep your database schema when you’re using mySQL or some other relational database, it’s important to keep the building blocks of your data store.
To do a full dump, it’s as simple as:
Naturally, that will be a pretty big mess, so instead you’ll want to restrict to a specific index.
Also, the pretty operator is a nice idea, that cleans things up by adding whitespace and formatting which really helps to visualize your templates.
Another good option is installing and using elasticdump from taskrabbit. It provides some more advanced options for exporting data and templates from your elasticsearch index.