I have a problem storing private Map<String, Set<String>> in elastic.
For example, I have a variable private Map<String, Set<String>> updatedFields with the following content:
"updatedFields": {
"key1": [
"val1",
"val2",
"val3"
],
"key2": [
"val1",
"val2",
"val3"
]
}
With the template mapping "updatedFields": {"type": "object"} elastic will create automappings for every key stored. This will lead to the following error if more than 1000 unique keys are stored:
failure in bulk execution:
[0]: index [md_activity_log_stg_ii], type [_doc], id [969d12df-d2c4-446f-975a-d95e76d6e720], message [ElasticsearchException[Elasticsearch exception [type=mapper_parsing_exception, reason=failed to parse]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Limit of total fields [1000] has been exceeded while adding new fields [1]]];]
By changing the setting to "updatedFields": {"type": "object", "enabled": false} the object is stored but without any content of the array itmes
Example of a document in Elastic after storing:
"updatedFields" : {
"34b49fbb-7ca8-4dc2-8c1f-21f88324b393" : [ ]
},
Anyone knows you to configure the field so that map is correctly stored without exceeding the field limit?