Hi,
I have an index with following schema:
GroupName,Time,Value
Example values:
G1 2020-01-01 1:00:00. 10
G2 2020-01-01 1:00:00. 15
G3 2020-01-01 1:00:00. 20
G1 2020-01-01 2:00:00. 10
G2 2020-01-01 2:00:00. 20
G3 2020-01-01 2:00:00. 30
G1 2020-01-01 3:00:00. 25
G2 2020-01-01 3:00:00. 10
G3 2020-01-01 3:00:00. 10
Out of above records G3 and G1 has top 2 values 30 and 25 respectively. So, need the all records of G1 and G2.
G1 2020-01-01 1:00:00. 10
G3 2020-01-01 1:00:00. 20
G1 2020-01-01 2:00:00. 10
G3 2020-01-01 2:00:00. 30
G1 2020-01-01 3:00:00. 25
G3 2020-01-01 3:00:00. 10
Is it possible to get this in single elastic query by using aggregations?