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

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

My mappings object look like this as of now:

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

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

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

I get parsing exception.

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

Please Help.

Thanks

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

Make sure you installed the plugin and restarted your nodes.

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.

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