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
_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.