# XGET to \_mapping does not match the mapping I used to create the index, is this normal?

**URL:** <https://discuss.elastic.co/t/xget-to--mapping-does-not-match-the-mapping-i-used-to-create-the-index-is-this-normal/17954>\
**Category:** Elasticsearch\
**Created:** [June 6, 2014, 1:31pm UTC](https://discuss.elastic.co/t/xget-to--mapping-does-not-match-the-mapping-i-used-to-create-the-index-is-this-normal/17954 "2014-06-06T13:31:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enno\_Shioji](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/enno_shioji/32/1504_2.png) [@Enno\_Shioji](https://discuss.elastic.co/u/Enno_Shioji)\
**Post date:** [June 6, 2014, 1:31pm UTC](https://discuss.elastic.co/t/xget-to--mapping-does-not-match-the-mapping-i-used-to-create-the-index-is-this-normal/17954/1 "2014-06-06T13:31:49Z")

</div>

Hi, I created my index using this mapping JSON:

{  
"myidx": {  
"index.refresh\_interval":"5m",  
"mappings": {  
"dynamic": "strict",  
"message": {  
"\_ttl": {  
"enabled": true  
},  
"properties": {  
"my\_nested\_thing": {  
"type": "nested",  
"properties": {  
"some\_id": {  
"type": "string", "index": "not\_analyzed"  
},  
"count": {  
"type": "long"  
},  
}  
}  
}  
}  
}  
}  
}

If I do a GET to \_mapping after indexing some documents, it will  
essentially return:

```
    {
        "message": {
            "properties": {
                "my_nested_thing": {
                    "properties": {
                        "some_id": {
                            "type": "string", "index": "not_analyzed"
                        },
                        "count": {
                            "type": "long"
                        },
                    }
                }
            }
        }
    }

```

I.e. "\_ttl": enabled=true and the "type": "nested" is not present from the  
mapping. I also noticed that it allows auto update to the mapping despite  
the "dynamic": "strict" instruction.

Does this mean these instructions are somehow not being reflected? If so,  
what am I doing wrong?

I'm using version 1.2.1

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b57199bf-c01f-4b86-9d8d-a4acfb06618c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b57199bf-c01f-4b86-9d8d-a4acfb06618c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [June 6, 2014, 2:29pm UTC](https://discuss.elastic.co/t/xget-to--mapping-does-not-match-the-mapping-i-used-to-create-the-index-is-this-normal/17954/2 "2014-06-06T14:29:26Z")

</div>

Hi,

How do you use API to create index?

I think “dynamic” property is wrong place.

I try to create index to use the following JSON and index;

curl -XPOST localhost:9200/myidx -d '  
{  
"settings": {  
"index.refresh\_interval": "5m"  
},  
"mappings": {  
"message": {  
"dynamic": "strict",  
"\_ttl": {  
"enabled": true  
},  
"properties": {  
"my\_nested\_thing": {  
"type": "nested",  
"properties": {  
"some\_id": {  
"type": "string",  
"index": "not\_analyzed"  
},  
"count": {  
"type": "long"  
}  
}  
}  
}  
}  
}  
}'

curl -XGET localhost:9200/myidx/\_mapping?pretty

{  
"myidx" : {  
"mappings" : {  
"message" : {  
"dynamic" : "strict",  
"\_ttl" : {  
"enabled" : true  
},  
"properties" : {  
"my\_nested\_thing" : {  
"type" : "nested",  
"properties" : {  
"count" : {  
"type" : "long"  
},  
"some\_id" : {  
"type" : "string",  
"index" : "not\_analyzed"  
}  
}  
}  
}  
}  
}  
}  
}

Does it make sense?

* * *

Jun Ohtani  
[johtani@gmail.com](mailto:johtani@gmail.com)  
blog : [http://blog.johtani.info](http://blog.johtani.info)  
twitter : [http://twitter.com/johtani](http://twitter.com/johtani)

2014/06/06 22:31、Enno Shioji [eshioji@gmail.com](mailto:eshioji@gmail.com) のメール：

> Hi, I created my index using this mapping JSON:
> 
> {  
> "myidx": {  
> "index.refresh\_interval":"5m",  
> "mappings": {  
> "dynamic": "strict",  
> "message": {  
> "\_ttl": {  
> "enabled": true  
> },  
> "properties": {  
> "my\_nested\_thing": {  
> "type": "nested",  
> "properties": {  
> "some\_id": {  
> "type": "string", "index": "not\_analyzed"  
> },  
> "count": {  
> "type": "long"  
> },  
> }  
> }  
> }  
> }  
> }  
> }  
> }
> 
> If I do a GET to \_mapping after indexing some documents, it will essentially return:
> 
> ```
> {
> "message": {
> "properties": {
> "my_nested_thing": {
> "properties": {
> "some_id": {
> "type": "string", "index": "not_analyzed"
> },
> "count": {
> "type": "long"
> },
> }
> }
> }
> }
> }
> 
> ```
> 
> I.e. "\_ttl": enabled=true and the "type": "nested" is not present from the mapping. I also noticed that it allows auto update to the mapping despite the "dynamic": "strict" instruction.
> 
> Does this mean these instructions are somehow not being reflected? If so, what am I doing wrong?
> 
> I'm using version 1.2.1
> 
> --  
> 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).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b57199bf-c01f-4b86-9d8d-a4acfb06618c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b57199bf-c01f-4b86-9d8d-a4acfb06618c%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Enno\_Shioji](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/enno_shioji/32/1504_2.png) [@Enno\_Shioji](https://discuss.elastic.co/u/Enno_Shioji)\
**Post date:** [June 6, 2014, 3:17pm UTC](https://discuss.elastic.co/t/xget-to--mapping-does-not-match-the-mapping-i-used-to-create-the-index-is-this-normal/17954/3 "2014-06-06T15:17:28Z")

</div>

Hi Jun,

Ah, I must be doing something wrong then. I'll correct the JSON and test  
again.

Btw わざわざテストしていただきありがとうございます！

On Friday, 6 June 2014 15:29:37 UTC+1, Jun Ohtani wrote:

> Hi,
> 
> How do you use API to create index?
> 
> I think “dynamic” property is wrong place.
> 
> I try to create index to use the following JSON and index;
> 
> curl -XPOST localhost:9200/myidx -d '  
> {  
> "settings": {  
> "index.refresh\_interval": "5m"  
> },  
> "mappings": {  
> "message": {  
> "dynamic": "strict",  
> "\_ttl": {  
> "enabled": true  
> },  
> "properties": {  
> "my\_nested\_thing": {  
> "type": "nested",  
> "properties": {  
> "some\_id": {  
> "type": "string",  
> "index": "not\_analyzed"  
> },  
> "count": {  
> "type": "long"  
> }  
> }  
> }  
> }  
> }  
> }  
> }'
> 
> curl -XGET localhost:9200/myidx/\_mapping?pretty
> 
> {  
> "myidx" : {  
> "mappings" : {  
> "message" : {  
> "dynamic" : "strict",  
> "\_ttl" : {  
> "enabled" : true  
> },  
> "properties" : {  
> "my\_nested\_thing" : {  
> "type" : "nested",  
> "properties" : {  
> "count" : {  
> "type" : "long"  
> },  
> "some\_id" : {  
> "type" : "string",  
> "index" : "not\_analyzed"  
> }  
> }  
> }  
> }  
> }  
> }  
> }  
> }
> 
> Does it make sense?
> 
> * * *
> 
> Jun Ohtani  
> [joh...@gmail.com](mailto:joh...@gmail.com) \<javascript:\>  
> blog : [http://blog.johtani.info](http://blog.johtani.info)  
> twitter : [http://twitter.com/johtani](http://twitter.com/johtani)
> 
> 2014/06/06 22:31、Enno Shioji \<[esh...@gmail.com](mailto:esh...@gmail.com) \<javascript:\>\> のメール：
> 
> > Hi, I created my index using this mapping JSON:
> > 
> > {  
> > "myidx": {  
> > "index.refresh\_interval":"5m",  
> > "mappings": {  
> > "dynamic": "strict",  
> > "message": {  
> > "\_ttl": {  
> > "enabled": true  
> > },  
> > "properties": {  
> > "my\_nested\_thing": {  
> > "type": "nested",  
> > "properties": {  
> > "some\_id": {  
> > "type": "string", "index":  
> > "not\_analyzed"  
> > },  
> > "count": {  
> > "type": "long"  
> > },  
> > }  
> > }  
> > }  
> > }  
> > }  
> > }  
> > }
> > 
> > If I do a GET to \_mapping after indexing some documents, it will  
> > essentially return:
> > 
> > ```
> > { 
> > "message": { 
> > "properties": { 
> > "my_nested_thing": { 
> > "properties": { 
> > "some_id": { 
> > "type": "string", "index": 
> > 
> > ```
> 
> "not\_analyzed"
> 
> > ```
> > }, 
> > "count": { 
> > "type": "long" 
> > }, 
> > } 
> > } 
> > } 
> > } 
> > } 
> > 
> > ```
> > 
> > I.e. "\_ttl": enabled=true and the "type": "nested" is not present from  
> > the mapping. I also noticed that it allows auto update to the mapping  
> > despite the "dynamic": "strict" instruction.
> > 
> > Does this mean these instructions are somehow not being reflected? If  
> > so, what am I doing wrong?
> > 
> > I'm using version 1.2.1
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/b57199bf-c01f-4b86-9d8d-a4acfb06618c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b57199bf-c01f-4b86-9d8d-a4acfb06618c%40googlegroups.com).
> 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7aeb3e33-4ad0-41d5-a27f-4e21b326e78d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7aeb3e33-4ad0-41d5-a27f-4e21b326e78d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [June 8, 2014, 3:32pm UTC](https://discuss.elastic.co/t/xget-to--mapping-does-not-match-the-mapping-i-used-to-create-the-index-is-this-normal/17954/4 "2014-06-08T15:32:13Z")

</div>

Hi,

You’re welcome.

Btw Twitterとかで聞いてもらっても答えますので、お気軽に。もちろん、MLのほうが皆さんに見えるのでいいのですが。

* * *

Jun Ohtani  
[johtani@gmail.com](mailto:johtani@gmail.com)  
blog : [http://blog.johtani.info](http://blog.johtani.info)  
twitter : [http://twitter.com/johtani](http://twitter.com/johtani)

2014/06/07 0:17、Enno Shioji [eshioji@gmail.com](mailto:eshioji@gmail.com) のメール：

> Hi Jun,
> 
> Ah, I must be doing something wrong then. I'll correct the JSON and test again.
> 
> Btw わざわざテストしていただきありがとうございます！
> 
> On Friday, 6 June 2014 15:29:37 UTC+1, Jun Ohtani wrote:  
> Hi,
> 
> How do you use API to create index?
> 
> I think “dynamic” property is wrong place.
> 
> I try to create index to use the following JSON and index;
> 
> curl -XPOST localhost:9200/myidx -d '  
> {  
> "settings": {  
> "index.refresh\_interval": "5m"  
> },  
> "mappings": {  
> "message": {  
> "dynamic": "strict",  
> "\_ttl": {  
> "enabled": true  
> },  
> "properties": {  
> "my\_nested\_thing": {  
> "type": "nested",  
> "properties": {  
> "some\_id": {  
> "type": "string",  
> "index": "not\_analyzed"  
> },  
> "count": {  
> "type": "long"  
> }  
> }  
> }  
> }  
> }  
> }  
> }'
> 
> curl -XGET localhost:9200/myidx/\_mapping?pretty
> 
> {  
> "myidx" : {  
> "mappings" : {  
> "message" : {  
> "dynamic" : "strict",  
> "\_ttl" : {  
> "enabled" : true  
> },  
> "properties" : {  
> "my\_nested\_thing" : {  
> "type" : "nested",  
> "properties" : {  
> "count" : {  
> "type" : "long"  
> },  
> "some\_id" : {  
> "type" : "string",  
> "index" : "not\_analyzed"  
> }  
> }  
> }  
> }  
> }  
> }  
> }  
> }
> 
> Does it make sense?
> 
> * * *
> 
> Jun Ohtani  
> [joh...@gmail.com](mailto:joh...@gmail.com)  
> blog : [http://blog.johtani.info](http://blog.johtani.info)  
> twitter : [http://twitter.com/johtani](http://twitter.com/johtani)
> 
> 2014/06/06 22:31、Enno Shioji [esh...@gmail.com](mailto:esh...@gmail.com) のメール：
> 
> > Hi, I created my index using this mapping JSON:
> > 
> > {  
> > "myidx": {  
> > "index.refresh\_interval":"5m",  
> > "mappings": {  
> > "dynamic": "strict",  
> > "message": {  
> > "\_ttl": {  
> > "enabled": true  
> > },  
> > "properties": {  
> > "my\_nested\_thing": {  
> > "type": "nested",  
> > "properties": {  
> > "some\_id": {  
> > "type": "string", "index": "not\_analyzed"  
> > },  
> > "count": {  
> > "type": "long"  
> > },  
> > }  
> > }  
> > }  
> > }  
> > }  
> > }  
> > }
> > 
> > If I do a GET to \_mapping after indexing some documents, it will essentially return:
> > 
> > ```
> > { 
> > "message": { 
> > "properties": { 
> > "my_nested_thing": { 
> > "properties": { 
> > "some_id": { 
> > "type": "string", "index": "not_analyzed" 
> > }, 
> > "count": { 
> > "type": "long" 
> > }, 
> > } 
> > } 
> > } 
> > } 
> > } 
> > 
> > ```
> > 
> > I.e. "\_ttl": enabled=true and the "type": "nested" is not present from the mapping. I also noticed that it allows auto update to the mapping despite the "dynamic": "strict" instruction.
> > 
> > Does this mean these instructions are somehow not being reflected? If so, what am I doing wrong?
> > 
> > I'm using version 1.2.1
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b57199bf-c01f-4b86-9d8d-a4acfb06618c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b57199bf-c01f-4b86-9d8d-a4acfb06618c%40googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7aeb3e33-4ad0-41d5-a27f-4e21b326e78d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7aeb3e33-4ad0-41d5-a27f-4e21b326e78d%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:23am UTC](https://discuss.elastic.co/t/xget-to--mapping-does-not-match-the-mapping-i-used-to-create-the-index-is-this-normal/17954/5 "2017-07-06T01:23:54Z")

</div>


