A agg query?


(Nick) #1

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!


(David Pilato) #2

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


(Nick) #3

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


(system) #4

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