I check my elasticsearch index because I head error "Fields limit exceeded". And I noticed elastic search create a new field in mapping always if nested filed has different name.
My document example:
"level": "Low",
"updated_at": "2022-05-22 13:19:12",
"distribution": {
"single": {
"1102": {
"groups": "Medium",
"groups_level_ids": [
null
],
"company": "Inter Cop",
}
},
"multiple_groups": [],
"all_levels": []
},
So the problem is with field distribution and nested field single.1102. That number (1102) is different in every document.
But why elastic treat all this field distribution.single.1102 as a new first level field if first level field is always distribution?
How to fix this issue?
CodePudding user response:
Elasticsearch flattens the JSON, hence distribution.single.1102
is created as a new field, you can refer how
Due to flattening reason, and you have a variable key field you are exhausting the field limit of Elasticsearch. To fix issue, you should model you data in a way that variables always comes in the value of a key field to avoid the issue.