We're working on a new data structure to display in Kibana and we've got the " Objects in arrays are not well supported" warning. We also found that creating queries on this data structure does not seem straightforward.
We're looking at "project usage" on a given period and we are recording the number of times a particular artifact has been used. To be able to create a trend, we also denormalize the data
to know the total usage, the usage per major generation and the usage per minor generation.
We'd like to have a pie chart for the major generation and a graph with multiple lines for the the minor generations (where they would display the share of each related to the total, see totalCount
).
What is the recommendation to structure this information in the index? The versions are not known in advance so an array sounds like an obvious choice for this.
{
"_index": "projects",
"_type": "download",
"_id": "AWeOZZcxe8fT5tlzG2HU",
"_version": 1,
"_score": null,
"_source": {
"from": 1541030400000,
"to": 1543622399000,
"projectId": "test",
"groupId": "com.example",
"artifactId": "acme",
"totalCount": 170,
"majorGenerations": [
{
"name": "0",
"count": 10
},
{
"name": "1",
"count": 160
}
],
"minorGenerations": [
{
"name": "0.8",
"count": 10
},
{
"name": "1.0",
"count": 60
},
{
"name": "1.2",
"count": 100
}
],
"stats": [
{
"version": "0.8.0",
"count": 10
},
{
"version": "1.0.0",
"count": 20
},
{
"version": "1.0.1",
"count": 40
},
{
"version": "1.2.0",
"count": 100
}
]
}
}