# Dynamic Mapping Issue-04032016

**URL:** https://discuss.elastic.co/t/dynamic-mapping-issue-04032016/46192
**Category:** Elasticsearch
**Created:** [April 4, 2016, 2:30am UTC](https://discuss.elastic.co/t/dynamic-mapping-issue-04032016/46192 "2016-04-04T02:30:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![logstash\_oz](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@logstash\_oz](https://discuss.elastic.co/u/logstash_oz)
#### Post date: [April 4, 2016, 2:30am UTC](https://discuss.elastic.co/t/dynamic-mapping-issue-04032016/46192/1 "2016-04-04T02:30:15Z")

</div>

Hi,

I am trying to create a dynamic template so that every number datatype(dynamically mapped) is indexed=true.  
I am using below command to create my index, and the string datatypes are getting indexed, but not the long.

curl -XPUT '[http://localhost:9200/my\_index?pretty](http://localhost:9200/my_index?pretty)' -d'  
{  
"mappings": {  
"my\_type": {  
"dynamic\_templates": [  
{  
"integers": {  
"match\_mapping\_type": "long",  
"mapping": {  
"type": "long",  
"index" : "not\_analyzed"  
}  
}  
},  
{  
"strings": {  
"match\_mapping\_type": "string",  
"mapping": {  
"type": "string",  
"index" : "not\_analyzed"  
}  
}  
}  
]  
}  
}  
}  
'

This is my data

curl -XPUT '[http://IP:9200/my\_index/my\_type/1?pretty](http://IP:9200/my_index/my_type/1?pretty)' -d'  
{  
"my\_integer": 5,  
"my\_string": "Some string"  
}'

 ![](https://us1.discourse-cdn.com/elastic/original/2X/a/a53ce1881f89bdba886760ec6a73a754853a66a6.png)

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 4, 2016, 9:06am UTC](https://discuss.elastic.co/t/dynamic-mapping-issue-04032016/46192/2 "2016-04-04T09:06:09Z")

</div>

Please format your code with `</>` icon so it won't be ugly.

What does this give?

```
curl 'http://IP:9200/my_index/my_type/_mapping?pretty'
```

---

<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, 11:02pm UTC](https://discuss.elastic.co/t/dynamic-mapping-issue-04032016/46192/3 "2017-07-05T23:02:39Z")

</div>


