Search by multiple aggregated fields, elastic 1.1


(Jose Ignacio Diez) #1

Hi, I'm a little bit newbie on this technology, so I was wondering if it's
posible to order for more than one aggregated fields. this is my query:

GET my_stats/stats/_search
{
"size" : 0,
"query" : {
"filtered" : {
"query" : {
"match_all" : { }
},
"filter" : {
"bool" : {
"must" : [ {
"term" : {
"MYID" : [ "130037364" ]
}
} ]
}
}
}
},
"aggregations" : {
"stats" : {
"terms" : {
"field" : "ADID",
"size" : 15000,
"order" : {
"LISTED.value" : "desc"
}
},
"aggregations" : {
"LISTED" : {
"sum" : {
"field" : "LISTED"
}
},
"DETAIL" : {
"sum" : {
"field" : "DETAIL"
}
},
"ALERTS" : {
"sum" : {
"field" : "ALERTS"
}
}
}
}
}
}

What I would like is if listed is equal in two aggregations take alerts to
order and if alerts the same take detail to order. I mean a proper
ordenation. I hope I explained properly.

Thanks in advance

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/066b1619-1c9c-484a-99bc-de0425e9de39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2