# Enable \_size field in elasticsearch mapping?

**URL:** <https://discuss.elastic.co/t/enable--size-field-in-elasticsearch-mapping/71721>\
**Category:** Elasticsearch\
**Created:** [January 16, 2017, 11:38am UTC](https://discuss.elastic.co/t/enable--size-field-in-elasticsearch-mapping/71721 "2017-01-16T11:38:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [January 16, 2017, 11:38am UTC](https://discuss.elastic.co/t/enable--size-field-in-elasticsearch-mapping/71721/1 "2017-01-16T11:38:57Z")

</div>

Hi,  
ES 2.4.0  
I want to enable the \_size field in elasticsearch mappings when i tried the following code

{  
"test": {  
"mappings": {  
"type1": {  
"\_size": {  
"enabled": true  
}  
}  
}  
}  
}

it is showing error like this

{  
"error": {  
"root\_cause": [  
{  
"type": "action\_request\_validation\_exception",  
"reason": "Validation Failed: 1: mapping type is missing;"  
}  
],  
"type": "action\_request\_validation\_exception",  
"reason": "Validation Failed: 1: mapping type is missing;"  
},  
"status": 400  
}

---

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [January 16, 2017, 1:06pm UTC](https://discuss.elastic.co/t/enable--size-field-in-elasticsearch-mapping/71721/2 "2017-01-16T13:06:33Z")

</div>

hey,  
i got the right syntax

PUT my\_index  
{  
"my\_type": {  
"\_size": {  
"enabled": true,  
"store": "true"  
}  
}  
}

---

<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:** [February 13, 2017, 1:06pm UTC](https://discuss.elastic.co/t/enable--size-field-in-elasticsearch-mapping/71721/3 "2017-02-13T13:06:36Z")

</div>

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