# Is it possible to have the settings and mappings in one config file

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-have-the-settings-and-mappings-in-one-config-file/12438>\
**Category:** Elasticsearch\
**Created:** [June 16, 2013, 12:51pm UTC](https://discuss.elastic.co/t/is-it-possible-to-have-the-settings-and-mappings-in-one-config-file/12438 "2013-06-16T12:51:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dantuff](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@dantuff](https://discuss.elastic.co/u/dantuff)\
**Post date:** [June 16, 2013, 12:51pm UTC](https://discuss.elastic.co/t/is-it-possible-to-have-the-settings-and-mappings-in-one-config-file/12438/1 "2013-06-16T12:51:02Z")

</div>

At the moment I have my mapping file in the location  
'ES\_HOME/config/default.mapping.json' and then I have to post my settings  
file containing custom analyzers and tokenizers via a curl command. Is  
there a way to place the settings configuration in the default-mapping.json  
along with the mappings making the configuration a one step process?

I have tried using the following format in the default-mapping.json but I'm  
getting the 'Mapping must have the `type` as the root object' error:

{  
"settings": {  
"index": {  
"analysis": {  
"filter": {  
....  
},  
"tokenizer": {  
....  
},  
"analyzer": {  
....  
}  
}  
}  
},  
"mappings": {  
"document": {  
"properties": {  
....  
}  
}  
}  
}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [June 16, 2013, 2:05pm UTC](https://discuss.elastic.co/t/is-it-possible-to-have-the-settings-and-mappings-in-one-config-file/12438/2 "2013-06-16T14:05:59Z")

</div>

Hello,

Yes, take a look at templates:

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

They can contain mappings and index settings, and you can put them in  
configuration files, as well as post them via curl.

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

On Sun, Jun 16, 2013 at 3:51 PM, es newbie [dan.tuffery@gmail.com](mailto:dan.tuffery@gmail.com) wrote:

> At the moment I have my mapping file in the location  
> 'ES\_HOME/config/default.mapping.json' and then I have to post my settings  
> file containing custom analyzers and tokenizers via a curl command. Is  
> there a way to place the settings configuration in the default-mapping.json  
> along with the mappings making the configuration a one step process?
> 
> I have tried using the following format in the default-mapping.json but  
> I'm getting the 'Mapping must have the `type` as the root object' error:
> 
> {  
> "settings": {  
> "index": {  
> "analysis": {  
> "filter": {  
> ....  
> },  
> "tokenizer": {  
> ....  
> },  
> "analyzer": {  
> ....  
> }  
> }  
> }  
> },  
> "mappings": {  
> "document": {  
> "properties": {  
> ....  
> }  
> }  
> }  
> }
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:31am UTC](https://discuss.elastic.co/t/is-it-possible-to-have-the-settings-and-mappings-in-one-config-file/12438/3 "2017-07-06T02:31:01Z")

</div>


