# Specify "\_size" and "properties" both in mappings for Index

**URL:** <https://discuss.elastic.co/t/specify-size-and-properties-both-in-mappings-for-index/123377>\
**Category:** Elasticsearch\
**Created:** [March 10, 2018, 7:48am UTC](https://discuss.elastic.co/t/specify-size-and-properties-both-in-mappings-for-index/123377 "2018-03-10T07:48:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohits1995](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mohits1995](https://discuss.elastic.co/u/mohits1995)\
**Post date:** [March 10, 2018, 7:48am UTC](https://discuss.elastic.co/t/specify-size-and-properties-both-in-mappings-for-index/123377/1 "2018-03-10T07:48:10Z")

</div>

Hi,

I want to map mappings for documents in index. For that, I have created mappings with properties as of now.  
But I also want to get the size of documents, for that, I found out that I need to enable "\_size" field as shown here :  
[https://www.elastic.co/guide/en/elasticsearch/plugins/current/mapper-size-usage.html](https://www.elastic.co/guide/en/elasticsearch/plugins/current/mapper-size-usage.html)

My mappings object look like this as of now:

```auto
{
	"mappings": {
		"doc": {
			"properties": {
				...
			}
		}
	}
}

```

where should I add "\_size" tag?  
If I do something like this :-

```auto
{
	"mappings": {
		"doc": {
			"properties": {
				...
			},
            "_size": {
	           	"enabled": true
            }
		}
	}
}

```

I get parsing exception.

If I place it inside properties, I cant get desired results.

Please Help.

Thanks

---

<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:** [March 10, 2018, 8:29am UTC](https://discuss.elastic.co/t/specify-size-and-properties-both-in-mappings-for-index/123377/2 "2018-03-10T08:29:06Z")

</div>

It looks good.  
You need to share the full error.

Make sure you installed the plugin and restarted your nodes.

---

<div class="post-metadata">

**Author:** ![mohits1995](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mohits1995](https://discuss.elastic.co/u/mohits1995)\
**Post date:** [March 10, 2018, 9:07am UTC](https://discuss.elastic.co/t/specify-size-and-properties-both-in-mappings-for-index/123377/3 "2018-03-10T09:07:57Z")

</div>

Hi David,  
Thank you so much for your response.

"Make sure you installed the plugin and restarted your nodes."  
This helped me in solving the error.

Thanks.

---

<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:** [April 7, 2018, 9:08am UTC](https://discuss.elastic.co/t/specify-size-and-properties-both-in-mappings-for-index/123377/4 "2018-04-07T09:08:12Z")

</div>

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