# Expanding the mapping adds field definitions to the mapping, but "acknowledged" is false

**URL:** <https://discuss.elastic.co/t/expanding-the-mapping-adds-field-definitions-to-the-mapping-but-acknowledged-is-false/3168>\
**Category:** Elasticsearch\
**Created:** [July 29, 2010, 8:45am UTC](https://discuss.elastic.co/t/expanding-the-mapping-adds-field-definitions-to-the-mapping-but-acknowledged-is-false/3168 "2010-07-29T08:45:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomislav\_Poljak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomislav_poljak/32/1177_2.png) [@Tomislav\_Poljak](https://discuss.elastic.co/u/Tomislav_Poljak)\
**Post date:** [July 29, 2010, 8:45am UTC](https://discuss.elastic.co/t/expanding-the-mapping-adds-field-definitions-to-the-mapping-but-acknowledged-is-false/3168/1 "2010-07-29T08:45:39Z")

</div>

Hi,  
when trying to expand mapping by adding a new field definition, mapping  
gets updated (I get update\_mapping in ES console) and I see new props  
when retrieving mapping definition, but mapping update results in  
response {"ok":true,"acknowledged":false}

What does it mean to have "ok":true, but "acknowledged":false?

Here are the steps to re-create:

1. Create index

curl -XPUT '[http://localhost:9200/twitter/](http://localhost:9200/twitter/)'

result: {"ok":true,"acknowledged":true}

1. Put default mapping

curl -XPUT '[http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d '  
{  
"tweet" : {  
"properties" : {  
"message" : {"type" : "string", "store" : "yes"}  
}  
}  
}  
'

result: {"ok":true,"acknowledged":true}

3a. Try to expand (first approach)

curl -XPUT '[http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d '  
{  
"tweet" : {  
"properties" : {  
"message" : {"type" : "string", "store" : "yes"},  
"newfield" : {"type" : "string", "store" : "yes"}  
}  
}  
}  
'

result: {"ok":true,"acknowledged":false}

3b. Try to expand (second approach, same steps 1. & 2.)

curl -XPUT '[http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d '  
{  
"tweet" : {  
"properties" : {  
"newfield" : {"type" : "string", "store" : "yes"}  
}  
}  
}  
'

result: {"ok":true,"acknowledged":false}

In both cases (3a. and 3b.) mapping gets expanded ( update\_mapping [tweet] in ES console) and I see a new field definition when retrieving mapping definition by

curl -XGET '[http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' \> mapping.txt

here is the props part of mapping:

"properties":{"message":{"omit\_term\_freq\_and\_positions":false,"index\_name":"message","index":"analyzed","omit\_norms":false,"store":"yes","boost":1.0,"term\_vector":"no","type":"string"},"newfield":{"omit\_term\_freq\_and\_positions":false,"index\_name":"newfield","index":"analyzed","omit\_norms":false,"store":"yes","boost":1.0,"term\_vector":"no","type":"string"}},

(for some reason I don't get nicely aligned mapping definition any more with 'get mapping')

Question: Am I trying to expand mapping correctly?

If not, what is the right way/syntax to expand mapping to add new field definition?  
If yes, why is "acknowledged":false in result: {"ok":true,"acknowledged":false}

(I'm using latest stable release of ElasticSearch version 0.9.0.)

Tomislav

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 29, 2010, 12:26pm UTC](https://discuss.elastic.co/t/expanding-the-mapping-adds-field-definitions-to-the-mapping-but-acknowledged-is-false/3168/2 "2010-07-29T12:26:05Z")

</div>

Hi,

The acknowledged part means that the updated mapping got updated on all  
the different nodes. In general, there is no reason why it won't be updated,  
its just a way to "wait" until the mappings gets propagated across the  
cluster. There is a timeout, and if the mappings were not acknowledged by  
all the current cluster nodes, then acknowledged flag is set to false and a  
response is returned.

Most times, the problem is with handling the acknowledgments, then the  
mappings not really being propagated through the cluster. I ran your example  
with a single node, and got this as well, so I fixed it (there was a problem  
with a single node in the cluster).  
[Put Mapping: When using a single node and updating a mapping, it is not marked as `acknowledged` · Issue #280 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/issue/280).

-shay.banon

On Thu, Jul 29, 2010 at 11:45 AM, Tomislav Poljak [tpoljak@gmail.com](mailto:tpoljak@gmail.com) wrote:

> Hi,  
> when trying to expand mapping by adding a new field definition, mapping  
> gets updated (I get update\_mapping in ES console) and I see new props  
> when retrieving mapping definition, but mapping update results in  
> response {"ok":true,"acknowledged":false}
> 
> What does it mean to have "ok":true, but "acknowledged":false?
> 
> Here are the steps to re-create:
> 
> 1. Create index
> 
> curl -XPUT '[http://localhost:9200/twitter/](http://localhost:9200/twitter/)'
> 
> result: {"ok":true,"acknowledged":true}
> 
> 1. Put default mapping
> 
> curl -XPUT '[http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d '  
> {  
> "tweet" : {  
> "properties" : {  
> "message" : {"type" : "string", "store" : "yes"}  
> }  
> }  
> }  
> '
> 
> result: {"ok":true,"acknowledged":true}
> 
> 3a. Try to expand (first approach)
> 
> curl -XPUT '[http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d '  
> {  
> "tweet" : {  
> "properties" : {  
> "message" : {"type" : "string", "store" : "yes"},  
> "newfield" : {"type" : "string", "store" : "yes"}  
> }  
> }  
> }  
> '
> 
> result: {"ok":true,"acknowledged":false}
> 
> 3b. Try to expand (second approach, same steps 1. & 2.)
> 
> curl -XPUT '[http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d '  
> {  
> "tweet" : {  
> "properties" : {  
> "newfield" : {"type" : "string", "store" : "yes"}  
> }  
> }  
> }  
> '
> 
> result: {"ok":true,"acknowledged":false}
> 
> In both cases (3a. and 3b.) mapping gets expanded ( update\_mapping [tweet]  
> in ES console) and I see a new field definition when retrieving mapping  
> definition by
> 
> curl -XGET '[http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' \> mapping.txt
> 
> here is the props part of mapping:
> 
> "properties":{"message":{"omit\_term\_freq\_and\_positions":false,"index\_name":"message","index":"analyzed","omit\_norms":false,"store":"yes","boost":1.0,"term\_vector":"no","type":"string"},"newfield":{"omit\_term\_freq\_and\_positions":false,"index\_name":"newfield","index":"analyzed","omit\_norms":false,"store":"yes","boost":1.0,"term\_vector":"no","type":"string"}},
> 
> (for some reason I don't get nicely aligned mapping definition any more  
> with 'get mapping')
> 
> Question: Am I trying to expand mapping correctly?
> 
> If not, what is the right way/syntax to expand mapping to add new field  
> definition?  
> If yes, why is "acknowledged":false in result:  
> {"ok":true,"acknowledged":false}
> 
> (I'm using latest stable release of Elasticsearch version 0.9.0.)
> 
> Tomislav

---

<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, 4:21am UTC](https://discuss.elastic.co/t/expanding-the-mapping-adds-field-definitions-to-the-mapping-but-acknowledged-is-false/3168/3 "2017-07-06T04:21:27Z")

</div>


