I have a difficult json structure I am trying to map and index in elasticsearch. Unfortunately I am not able to restructure this json to make it more palatable for indexing.
The primary challenge is essentially a Map<UUID, Object>, .e.g
...
"simple": "value",
"number": 5513,
"someInfos": {
"D3BAE30D-2548-488F-BA60-5C12B30C1497" : {
"data" : "I want to index",
"more" : "predictable struture",
"etc" : "and so on"
},
"D29F6A0B-A765-48F0-A2D6-D5FE8CEF14D6" : {
"data" : "more stuff to index",
"youget" : "the idea here"
}
}
If I just naively try to index without an explicit mapping, the high cardinality of uuid's in the map causes Limit of total fields [1000] in index [example] has been exceeded
.
I am currently getting around this problem by setting these maps "enabled": false
, but I will need these values to be indexed and searchable. Ideally, I would be able to index each of these map entries as nested docs, using the UUID as the doc id for the nested doc.
While searching, I found this topic that sounded promising: How to map a dynamic map of key values? , but the nested doc link it refers to has been relocated in 7.5.0, and the current docs only make mention of nested ARRAYs of objects, not maps.
Is there a way to accomplish this via mappings or dynamic templates?
TIA.