Heya Fantast7,
Firstly, the absolutely easiest thing to do would be to try to format / transform your input data to look like this (basically put the field values in the field name);
"BSEG.KOART.D" : 402.4,
"BSEG.KOART.S" : 356.46,
I would do this if you can. These fields could be added additionally to the original fields (same data with different structure in the same index).
Second, if you 'split ' a event by a repeating group in your data into multiple sub events you can send all the split events to a single index (no need to have a separate index for each KOART and account). This option seems pretty easy - consider setting best compression in your index settings which should save you some space. E.g.
{
"settings": {
"number_of_shards": 5,
"number_of_replicas": 0,
"index.codec": "**best_compression**",
"index.refresh_interval" : "1s"
},
Thirdly, If you are running elastic 6.2 (which includes vega) and you are willing to learn how to use nested mappings and nested queries and vega-lite, consider duplicating the BSEG field and storing it in both nested and non nested structure in the same index. E.g.
{
"BSEG": [
{
"DMBTR": 402.4,
"KOART": "D"
},
{
"DMBTR": 356.46,
"KOART": "S"
}
], "BSEGnested": [
{
"DMBTR": 402.4,
"KOART": "D"
},
{
"DMBTR": 356.46,
"KOART": "S"
}
]
}
This will means that you need to set a index _mapping before you post any data into the index. Basically just set the "type" of the "BSEGnested" field to be "nested".
"BSEGnested": {
"type": "nested",
"properties": {
Once you have done that you can create vega-lite queries against the nested documents. Normal visualisations will not be able be to be run against the nested field - however you will still have the flatten ones to query against.
There are a few options - the third one requires a lot more effort than the first and second one.