# When are mappings persisted?

**URL:** <https://discuss.elastic.co/t/when-are-mappings-persisted/14196>\
**Category:** Elasticsearch\
**Created:** [October 31, 2013, 5:10pm UTC](https://discuss.elastic.co/t/when-are-mappings-persisted/14196 "2013-10-31T17:10:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oliver\_B\_Fischer](https://avatars.discourse-cdn.com/v4/letter/o/f04885/32.png) [@Oliver\_B\_Fischer](https://discuss.elastic.co/u/Oliver_B_Fischer)\
**Post date:** [October 31, 2013, 5:10pm UTC](https://discuss.elastic.co/t/when-are-mappings-persisted/14196/1 "2013-10-31T17:10:22Z")

</div>

I have a bunch of scripts to setup my development and production system.  
Now I recognized that ElasticSearch does not persist the configuration  
of new indexes if I create the index and immediately shut down  
ElasticSearch:

curl -X PUT [http://localhost:9200/myindex](http://localhost:9200/myindex) -d @mapping.json  
curl -X POST [http://localhost:9200/\_shutdown?pretty](http://localhost:9200/_shutdown?pretty)

If I wait around 20s between index creation and shutting down ES the  
configuration will be saved.

So, that is fine for my production setup but not so fine for  
development. Can I change this somehow?

Bye,

Oliver

--  
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:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [October 31, 2013, 5:40pm UTC](https://discuss.elastic.co/t/when-are-mappings-persisted/14196/2 "2013-10-31T17:40:09Z")

</div>

Sending a refresh to "myindex" should work.

Jörg

--  
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:** ![Oliver\_B\_Fischer](https://avatars.discourse-cdn.com/v4/letter/o/f04885/32.png) [@Oliver\_B\_Fischer](https://discuss.elastic.co/u/Oliver_B_Fischer)\
**Post date:** [October 31, 2013, 5:59pm UTC](https://discuss.elastic.co/t/when-are-mappings-persisted/14196/3 "2013-10-31T17:59:09Z")

</div>

No, same result. Index settings are not persisted.

Am 31.10.13 18:40, schrieb [joergprante@gmail.com](mailto:joergprante@gmail.com):

> Sending a refresh to "myindex" should work.
> 
> Jörg
> 
> --  
> 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:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [October 31, 2013, 9:01pm UTC](https://discuss.elastic.co/t/when-are-mappings-persisted/14196/4 "2013-10-31T21:01:54Z")

</div>

The default master node timeout for create index operation is 30 seconds. I  
can't tell why a cluster change takes so long to get persisted, is it a  
large cluster?

Jörg

--  
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:** ![Oliver\_B\_Fischer](https://avatars.discourse-cdn.com/v4/letter/o/f04885/32.png) [@Oliver\_B\_Fischer](https://discuss.elastic.co/u/Oliver_B_Fischer)\
**Post date:** [November 1, 2013, 9:42am UTC](https://discuss.elastic.co/t/when-are-mappings-persisted/14196/5 "2013-11-01T09:42:54Z")

</div>

No, currently a single node.

Am 31.10.13 22:01, schrieb [joergprante@gmail.com](mailto:joergprante@gmail.com):

> The default master node timeout for create index operation is 30  
> seconds. I can't tell why a cluster change takes so long to get  
> persisted, is it a large cluster?
> 
> Jörg
> 
> --  
> 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:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 1, 2013, 10:56am UTC](https://discuss.elastic.co/t/when-are-mappings-persisted/14196/6 "2013-11-01T10:56:18Z")

</div>

I tested it with 0.90.5 but I had no trouble in a dev environment (single  
node on Mac OS X)

curl -XDELETE 'localhost:9200/test'

curl -XPUT 'localhost:9200/test' -d '  
{  
"mappings" : {  
"docs" : {  
"properties" : {  
"content" : {  
"type" : "string"  
}  
}  
}  
}  
}  
'

curl -XPOST 'localhost:9200/\_shutdown'

Server shut down immediately in 1s, and after

./bin/elastiscearch -f

I can receive the mapping

curl -XGET 'localhost:9200/test/\_mapping'  
{"test":{"docs":{"properties":{"content":{"type":"string"}}}}}

Jörg

--  
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:** ![Oliver\_B\_Fischer](https://avatars.discourse-cdn.com/v4/letter/o/f04885/32.png) [@Oliver\_B\_Fischer](https://discuss.elastic.co/u/Oliver_B_Fischer)\
**Post date:** [November 1, 2013, 1:02pm UTC](https://discuss.elastic.co/t/when-are-mappings-persisted/14196/7 "2013-11-01T13:02:38Z")

</div>

I will try to provide an example for this problem. Ok?

Am 01.11.13 11:56, schrieb [joergprante@gmail.com](mailto:joergprante@gmail.com):

> I tested it with 0.90.5 but I had no trouble in a dev environment  
> (single node on Mac OS X)
> 
> curl -XDELETE 'localhost:9200/test'
> 
> curl -XPUT 'localhost:9200/test' -d '  
> {  
> "mappings" : {  
> "docs" : {  
> "properties" : {  
> "content" : {  
> "type" : "string"  
> }  
> }  
> }  
> }  
> }  
> '
> 
> curl -XPOST 'localhost:9200/\_shutdown'
> 
> Server shut down immediately in 1s, and after
> 
> ./bin/elastiscearch -f
> 
> I can receive the mapping
> 
> curl -XGET 'localhost:9200/test/\_mapping'  
> {"test":{"docs":{"properties":{"content":{"type":"string"}}}}}
> 
> Jörg
> 
> --  
> 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:** ![Oliver\_B\_Fischer](https://avatars.discourse-cdn.com/v4/letter/o/f04885/32.png) [@Oliver\_B\_Fischer](https://discuss.elastic.co/u/Oliver_B_Fischer)\
**Post date:** [November 6, 2013, 10:34am UTC](https://discuss.elastic.co/t/when-are-mappings-persisted/14196/8 "2013-11-06T10:34:23Z")

</div>

Hello Jörg,

it seems so that this problem is somehow related to my setup. I call  
cURL from Ant.

If I do the same in the shell or via script this problem does not occur.

BR

Oliver

Am 01.11.13 14:02, schrieb Oliver B. Fischer:

> I will try to provide an example for this problem. Ok?
> 
> Am 01.11.13 11:56, schrieb [joergprante@gmail.com](mailto:joergprante@gmail.com):
> 
> > I tested it with 0.90.5 but I had no trouble in a dev environment  
> > (single node on Mac OS X)
> > 
> > curl -XDELETE 'localhost:9200/test'
> > 
> > curl -XPUT 'localhost:9200/test' -d '  
> > {  
> > "mappings" : {  
> > "docs" : {  
> > "properties" : {  
> > "content" : {  
> > "type" : "string"  
> > }  
> > }  
> > }  
> > }  
> > }  
> > '
> > 
> > curl -XPOST 'localhost:9200/\_shutdown'
> > 
> > Server shut down immediately in 1s, and after
> > 
> > ./bin/elastiscearch -f
> > 
> > I can receive the mapping
> > 
> > curl -XGET 'localhost:9200/test/\_mapping'  
> > {"test":{"docs":{"properties":{"content":{"type":"string"}}}}}
> > 
> > Jörg
> > 
> > --  
> > 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:08am UTC](https://discuss.elastic.co/t/when-are-mappings-persisted/14196/9 "2017-07-06T02:08:35Z")

</div>


