I am trying to get total unique record and sum of amount of those unique data. How to get it in Elastic Search query.My Sample input data is
{"amt":"2.9",
"recName":"Item2",
"recID":"r1",
"exeDate":"2022-03-19T02:51:06.948Z",
"inputDate":"2022-03-19"}
{"amt":"2.9",
"recName":"Item2",
"recID":"r1",
"exeDate":"2022-03-19T02:52:06.948Z",
"inputDate":"2022-03-19"}
{"amt":"1.8",
"recName":"Item1",
"recID":"r2",
"exeDate":"2022-03-19T02:51:06.948Z",
"inputDate":"2022-03-19"}
I am expecting output:
recName: Item1, Item2
recNameCount : 2
amount: 4.7