I have a following elasticsearch query and result. I want something like group by with count(*) =1 in sql statement
{
"size": 0,
"aggs": {
"group_by_RequestID": {
"terms": {
"field": "RequestID"
}
}
}
}
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 12,
"max_score": 0,
"hits": []
},
"aggregations": {
"group_by_RequestID": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "20160209 132857.249_5420_1_ATL",
"doc_count": 2
},
{
"key": "20160209 132857.249_5420_1_DEN1100",
"doc_count": 2
},
{
"key": "20160209 132857.249_5420_1_LAS",
"doc_count": 2
},
{
"key": "20160209 132857.249_5420_1_PHX1300",
"doc_count": 2
},
{
"key": "20160209 132857.249_5420_1_PHX1400",
"doc_count": 2
},
{
"key": "20160209 132857.249_5420_1_SFO",
"doc_count": 2
}
]
}
}
}
I want my result to be back where "doc_count": 1, can you guide me how to get that result ?