I need some help with a query:
I have a "students" index, and each student has a "classroomId" and a "grade" fields.
I need to get the best student in each class.
I'm using "aggs", but what I get is the list of all students, and in the aggregations section, the number of students of each class.
Maybe "aggs" is not designed for this purpose. Whay I need to use instead of it?