خرید بک لینک

Vote count: 0

I am using top_hits_aggregation to get my users last visited document. I want to group by the results of top_hits_aggregation.

Sample Rows Retued

{
  "lastvisited_users": {
   "buckets": [
     { 
      "top_user_hits": {
        "hits": {
           "hits": [
              { _source: {"c": "s"}},
              { _source: {"c": "s,b"}}, 
              { _source: {"c": "s"}}, 
           ] 
         }
       }
     }
   ]
 }

}

I want to group by the results by field "c".

Expected

{
"s": 2,
"s,b": 1
}

I am using elasticsearch version 1.7 in production. How to do this?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 15 فروردين 1395 ساعت: 19:33

صفحه بندی