Install index mapping stored in a file - elasticsearch 7.x

Hi there,

I have a json file with an index mapping definition in it. What is the best way to import it into elasticsearch? I would like to do it via curl / CLI.

Just point curl to the file and give the template a name:

curl -XPUT 'http://localhost:9200/_template/my_index_templ' -H 'Content-Type: application/json' -d @your_file.json

Good luck!

Thank you!

1 Like

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