A agg query?

i have some Social Data, such as weibo, twitter, they have same mapping. for example:
{
text:" i am a weibo", type:"weibo",name:"name1",fans:"1000"
}

{
text:" i am a weibo 2", type:"weibo",name:"name2",fans:"10"
}

{
text:" i am a twitter ", type:"twitter",name:"name3",fans:"1080"
}

{
text:" i am a weibo 3", type:"weibo",name:"name1",fans:"1000"
}

i want to get the result like this:
{
"name1":1000,
"name2":10
}

could you help me ? Thank you in advance!

What about a terms agg on name then a max sub agg on fans?
Note that fans should be a number though.

1 Like

Thanks dadoonet. I do resolved my problem like you said.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.