Therefore in my kibana index "student" there are three documents one for each student and each student has the following fields:
studentname,test1,test2,test3,test4
that should be fine. but it depends how you modeled your documents in Elasticsearch:
you have 3 documents (one doc for each student), each document with 4 fields (one for each test).
Even though it looks the simplest, ES is not a spreadsheet. So this won't work. The aggregation framework is not build for this.
the canonical way of doing this in Elasticsearch would be to denormalize your data, and have a separate document for each student and test combo. You'd have 12 documents. Each document would have a student-field, a testid field and a testscore field.
Then you can just do two nested "Terms aggregation", once on testid, which you can map to the X-axis, and once on student, which you use to split the series . On the Y-axis you plot the computed metric, in this case the (average) score per student.
It's easier to think of Elasticsearch as storing a collection of measurements (sensor data, log data, ...). A test-score is basically a measurement for the tuple {student, testid}.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.