elasticsearch export specific index mappings

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:
http://localhost:9200/_mappings

Naturally, that will be a pretty big mess, so instead you’ll want to restrict to a specific index.
http://localhost:9200/my-awesome-index/_mappings

Also, the pretty operator is a nice idea, that cleans things up by adding whitespace and formatting which really helps to visualize your templates.
http://localhost:9200/_template/?pretty

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.
https://github.com/taskrabbit/elasticsearch-dump

Comments