# Why mapping does not work as respect?

**URL:** <https://discuss.elastic.co/t/why-mapping-does-not-work-as-respect/150103>\
**Category:** Elasticsearch\
**Created:** [September 27, 2018, 2:21am UTC](https://discuss.elastic.co/t/why-mapping-does-not-work-as-respect/150103 "2018-09-27T02:21:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hellokitty](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hellokitty/32/29959_2.png) [@hellokitty](https://discuss.elastic.co/u/hellokitty)\
**Post date:** [September 27, 2018, 2:21am UTC](https://discuss.elastic.co/t/why-mapping-does-not-work-as-respect/150103/1 "2018-09-27T02:21:35Z")

</div>

ElasticSearch 6.3

I create one index call [myindex3]. It's mapping look like below.

{  
"myindex3": {  
"mappings": {  
"\_doc": {  
"properties": {  
"tags": {  
"type": "long"  
}  
}  
}  
}  
}  
}

I can create docs which has string value in the [tags] filed . See below:

{  
"took": 1,  
"timed\_out": false,  
"\_shards": {  
"total": 5,  
"successful": 5,  
"skipped": 0,  
"failed": 0  
},  
"hits": {  
"total": 2,  
"max\_score": 1,  
"hits": [  
{  
"\_index": "myindex3",  
"\_type": "\_doc",  
"\_id": "2",  
"\_score": 1,  
"\_source": {  
"tags": "123"  
}  
},  
{  
"\_index": "myindex3",  
"\_type": "\_doc",  
"\_id": "1",  
"\_score": 1,  
"\_source": {  
"tags": 123  
}  
}  
]  
}  
}

---

<div class="post-metadata">

**Author:** ![hellokitty](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hellokitty/32/29959_2.png) [@hellokitty](https://discuss.elastic.co/u/hellokitty)\
**Post date:** [September 27, 2018, 2:44am UTC](https://discuss.elastic.co/t/why-mapping-does-not-work-as-respect/150103/2 "2018-09-27T02:44:24Z")

</div>

May be I know the answer. I check the elasticsearch logic. ElasticSearch will transform the "string" value into long value. If it transfer the value successfully,error will not be throw! And the stored filed will pack the whole doc into one value which will be stored in lucene's one field!

---

<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:** [October 25, 2018, 2:44am UTC](https://discuss.elastic.co/t/why-mapping-does-not-work-as-respect/150103/3 "2018-10-25T02:44:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
