Display field-specific information individually

I have an index named firedrill. All documents in that index have a field named DrillSteps:

"DrillSteps": [
	{
		"Errors": [
			"Oven door opened before fuses were turned off."
		],
		"NumErrors": 1,
		"Name": "Fuses turned off."
	},
	{
		"Errors": [
			"Fuses turned on again before oven was safe",
			"Door was not closed again fast enough"
		],
		"NumErrors": 2,
		"Name": "Oven door closed again."
	},
	{
		"Errors": [
			"Oven opened before protective gear worn."
		],
		"NumErrors": 1,
		"Name": "Protective gear worn."
	},
	{
		"Errors": [],
		"NumErrors": 0,
		"Name": "Oven smoke died out."
	},
	{
		"Errors": [],
		"NumErrors": 0,
		"Name": "Burnt meal disposed of."
	}
]

All you can see, each step has a name, and a list of errors committed by the student when going through that particular step. Each drill step has a specific list of possible errors. E.g. the error "Oven opened before protective gear worn" is specific to the step "Protective gear worn".

I would like to create a graph, where the y-axis shows drill errors grouped by drill steps. Importantly, drill errors that are not possible values for a drill step are not shown. The x-axis should display the error count.

Currently, this is how I have defined my graph:

And this is the output:

The count on the x-axis refers to the document count.

As you can see, this is not what I want. I am obviously doing something wrong, so I would appreciate receiving feedback on what changes I must make (either to how I defined my graph or to how I designed the data schema) in order to display my desired graph.

If anything is unclear, please let me know and I will rephrase and/or provide more information.

@Miao

I think you're running into an issue with your data not being de-normalized. I'm not sure you can express that query in Kibana on your nested datastructure.

You could re-index the data where each document is an actual tuple of step in the process/error at that step. Then you could create that chart with a similar configuration as you have now.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.