es cat order by shopid

{
“size”: 0,
“query”: {
“match_phrase”: {
“rootCategoryId”: “1512”
}
},”aggs”: {
“timeStamp”: {
“terms”: {
“field”: “timeStamp”,
“size”: 24
}
,”aggs”: {
“categoryId”: {
“terms”: {
“field”: “categoryId”,
“size”: 100
},”aggs”: {
“brandValueId”: {
“terms”: {
“field”: “brandValueId”,
“size”: 1000
},”aggs”: {
“shopId”: {
“terms”: {
“field”: “shopId”,
“size”: 1000,
“order”: {
“sum_sell”: “desc”
}
},”aggs”: {
“sum_sell”: {
“sum”: {
“field”: “sellCount”
}
},
“sum_sale”:{
“sum”: {
“field”: “salesAmount”
}
}
}
}
}
}
}
}}}}}

Leave a Reply

Your email address will not be published. Required fields are marked *