# Loading templates/mapping when initializing a elasticsearch server?

**URL:** <https://discuss.elastic.co/t/loading-templates-mapping-when-initializing-a-elasticsearch-server/61172>\
**Category:** Elasticsearch\
**Created:** [September 21, 2016, 6:53pm UTC](https://discuss.elastic.co/t/loading-templates-mapping-when-initializing-a-elasticsearch-server/61172 "2016-09-21T18:53:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blommis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blommis/32/98529_2.png) [@blommis](https://discuss.elastic.co/u/blommis)\
**Post date:** [September 21, 2016, 6:53pm UTC](https://discuss.elastic.co/t/loading-templates-mapping-when-initializing-a-elasticsearch-server/61172/1 "2016-09-21T18:53:44Z")

</div>

Hi,

I have a project consisting of 3 maven modules, one for specification, one for data node and one for master.  
The data module consist of a config directory with elasticsearch.yml. This is as well included for the master module.

First when I googled for how to set a default mapping I found the documentation for an old version 1,6  
[https://www.elastic.co/guide/en/elasticsearch/reference/1.6/indices-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/1.6/indices-templates.html)

Where it was possible to package the server including template files.

This does not seem to be possible in 2.4, Is there any other way how I should handle this?

The only alternative way to do this as I understand it:

- start elasticsearch server
- make a (curl) PUT request with a setting for the index or a template
- index my document

Or is there another good way? And why doesn't it seem to be possible to have this in the configuration?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:18pm UTC](https://discuss.elastic.co/t/loading-templates-mapping-when-initializing-a-elasticsearch-server/61172/2 "2017-07-05T22:18:25Z")

</div>


