# How to determine "index.mapping.total\_fields.limit" in an Index in ES 6.3

**URL:** <https://discuss.elastic.co/t/how-to-determine-index-mapping-total-fields-limit-in-an-index-in-es-6-3/213978>\
**Category:** Elasticsearch\
**Created:** [January 7, 2020, 5:08am UTC](https://discuss.elastic.co/t/how-to-determine-index-mapping-total-fields-limit-in-an-index-in-es-6-3/213978 "2020-01-07T05:08:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harshraj\_Shinde](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshraj_shinde/32/49860_2.png) [@Harshraj\_Shinde](https://discuss.elastic.co/u/Harshraj_Shinde)\
**Post date:** [January 7, 2020, 5:08am UTC](https://discuss.elastic.co/t/how-to-determine-index-mapping-total-fields-limit-in-an-index-in-es-6-3/213978/1 "2020-01-07T05:08:31Z")

</div>

Hello,

> PUT test1  
> {  
> "mappings": {  
> "\_doc": {  
> "properties": {  
> "field1":{  
> "type":"text"  
> },  
> "field2":{  
> "type":"text"  
> },  
> "field3":{  
> "type":"text"  
> }  
> }  
> }  
> },  
> "settings": {  
> "analysis": {  
> "normalizer": {  
> "ExportRawAnalyzer": {  
> "filter": "lowercase",  
> "type": "custom",  
> "char\_filter": {  
> "char\_filter": "html\_strip"  
> }  
> }  
> },  
> "analyzer": {  
> "ExportPrimaryAnalyzer": {  
> "filter": "lowercase",  
> "char\_filter": "html\_strip",  
> "type": "custom",  
> "tokenizer": "whitespace"  
> }  
> }  
> }  
> }  
> }

These are my index settings.

Now I ran this query:

> PUT test1/\_settings  
> {  
> "index.mapping.total\_fields.limit": 3  
> }

I inserted this doc:

> PUT test1/\_doc/d1  
> {  
> "field1":"d1\_f1value",  
> "field2":"d1\_f2value",  
> "field3":"d1\_f3value"  
> }

It is inserting properly.  
But when I tried to insert

> PUT test1/\_doc/d2  
> {  
> "field1":"d2\_f1value",  
> "field2":"d2\_f2value",  
> "field3":"d2\_f3value",  
> "field4":"d2\_f4value"  
> }

I am getting and error of field limit exceeded.  
Then I changed this to 16 as below:

> PUT test1/\_settings  
> {  
> "index.mapping.total\_fields.limit": 16  
> }

Then the d2 doc is being inserted.

I want to know how this is being calculated. Why not

> PUT test1/\_settings  
> {  
> "index.mapping.total\_fields.limit": 4  
> }  
> this is not working.

---

<div class="post-metadata">

**Author:** ![Harshraj\_Shinde](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshraj_shinde/32/49860_2.png) [@Harshraj\_Shinde](https://discuss.elastic.co/u/Harshraj_Shinde)\
**Post date:** [January 8, 2020, 10:52am UTC](https://discuss.elastic.co/t/how-to-determine-index-mapping-total-fields-limit-in-an-index-in-es-6-3/213978/2 "2020-01-08T10:52:16Z")

</div>

Hi,  
Below is my analysis on this,

#Mapping for test1 when we have 1 field dynamic:  
\> {

> ```
> "test1": {
> "mappings": {
> "_doc": {
> "properties": {
> "field1": {
> "type": "text", 
> "fields": {
> "keyword": {
> "type": "keyword",
> "ignore_above": 256
> }
> }
> }
> }
> }
> }
> }
> }
> 
> ```

When Total: 1 field all dynamic: index.mapping.total\_fields.limit = 13 (11(meta fields) + 2(for type dynamic))  
When Total: 2 fields all dynamic:index.mapping.total\_fields.limit = 15 (11(meta fields) +2(for type dynamic) +2(for type dynamic))

#Mapping for test2 when we have 1 static field but total\_fields limit is '0' :

> {  
> "test2": {  
> "aliases": {},  
> "mappings": {  
> "\_doc": {  
> "properties": {  
> "field1": {  
> "type": "text"  
> }  
> }  
> }  
> },  
> "settings": {  
> "index": {  
> "mapping": {  
> "total\_fields": {  
> "limit": "0"  
> }  
> },  
> "number\_of\_shards": "5",  
> "provided\_name": "test5",  
> "creation\_date": "1578395477727",  
> "number\_of\_replicas": "1",  
> "uuid": "LO\_a8woySs216VkyQoVzmg",  
> "version": {  
> "created": "6030099"  
> }  
> }  
> }  
> }  
> }

If fields are defined in the index mappings(Not Dynamically) then limit setting is not considered at all.

#Mapping for test3 when we have 1 static field and 1 dynamic field:

> {  
> "test3": {  
> "aliases": {},  
> "mappings": {  
> "\_doc": {  
> "properties": {  
> "field1": {  
> "type": "text"  
> },  
> "field3": {  
> "type": "text",  
> "fields": {  
> "keyword": {  
> "type": "keyword",  
> "ignore\_above": 256  
> }  
> }  
> }  
> }  
> }  
> },  
> "settings": {  
> "index": {  
> "mapping": {  
> "total\_fields": {  
> "limit": "14"  
> }  
> },  
> "number\_of\_shards": "5",  
> "provided\_name": "test4",  
> "creation\_date": "1578393184484",  
> "number\_of\_replicas": "1",  
> "uuid": "NpL3Vn65RP-V126NK\_Wzng",  
> "version": {  
> "created": "6030099"  
> }  
> }  
> }  
> }  
> }

When Total: 2 fields in which 1 dynamic :index.mapping.total\_fields.limit = 14 (11(meta fields) +1(for type normal) + 2(for type dynamic))  
When Total: 4 fields in which 1 dynamic :index.mapping.total\_fields.limit = 16 (11(meta fields) +3(for type normal) +2(for type dynamic))  
When Total: 5 fields in which 2 dynamic :index.mapping.total\_fields.limit = 18 (11(meta fields) +3(for type normal) +2(for type dynamic)+2(for type dynamic))

So basically we have 11(meta fields) not sure which these fields exactly are but found this from  
**[Doc: Clarify count for index.mapping.total\_fields.limit · Issue #24096 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/24096)**  
\_routing  
\_ttl  
\_index  
\_type  
\_all  
\_parent  
\_field\_names  
\_source  
\_id  
\_version  
\_timestamp  
\_uid

Here there are 12 fields, but currently I don't know which are there in these 11(meta fields) not sure about this.

---

<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 5, 2020, 10:52am UTC](https://discuss.elastic.co/t/how-to-determine-index-mapping-total-fields-limit-in-an-index-in-es-6-3/213978/3 "2020-02-05T10:52:17Z")

</div>

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