I want to gather statistics over a field names "CpuEff" for each unique field "DESIRED_CMS_Dataset". So I wrote this,
curl -XPOST 'http://localhost:9200/cms-2016-03-30/job/_search?pretty=true' -D'
{
"aggregations" : {
"data" : {
"terms": {
"field": "DESIRED_CMSDataset"
"order": {
"cnt" : "desc"
}
},
"aggregations" : {
"data_stats" : {
"extended_stats" : { "field" : "CpuEff" }
}
}
}
}
}'
This gives an neither gives me the statistics nor gives me just the field DESIRED_CMSDataset. Instead I get a bunch of
{
"_index" : "cms-2016-03-30",
"_type" : "job",
"_id" : "[email protected]#6248657.0#1459314096",
"_score" : 1.0,
"_source" : {
"CoreHr" : 1.1066666666666667,
"DataCollectionDate" : 1459318128,
"JobStartDate" : 1459314144,
"Requirements" : false,
...
So I would like to fix my query so that I only see DESIRED_CMSDataset and the results that this says I should get (ie avg, sum, ...) for each unique value of DESIRED_CMSDataset.