-
-
Save anonymous/391b510dfc9467158a8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"index": "myrecords", | |
"type": "eachrecord" | |
}, | |
{ | |
"size": 0, | |
"aggs": { | |
"total_cost": { | |
"terms": { | |
"field": "year" | |
}, | |
"aggs": { | |
"total_sum": { | |
"sum": { | |
"field": "paidAmount" | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"size": 0, | |
"aggs": { | |
"total_cost": { | |
"terms": { | |
"field": "in" | |
}, | |
"aggs": { | |
"total_sum": { | |
"sum": { | |
"field": "paidAmount" | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"size": 0, | |
"aggs": { | |
"total_cost": { | |
"terms": { | |
"field": "quarter" | |
}, | |
"aggs": { | |
"total_sum": { | |
"sum": { | |
"field": "paidAmount" | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"size": 0, | |
"aggs": { | |
"total_cost": { | |
"terms": { | |
"field": "month", | |
"size": 12 | |
}, | |
"aggs": { | |
"total_sum": { | |
"sum": { | |
"field": "paidAmount" | |
} | |
}, | |
"each": { | |
"terms": { | |
"field": "year", | |
"size": 3 | |
}, | |
"aggs": { | |
"total_sum": { | |
"sum": { | |
"field": "paidAmount" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"size": 0, | |
"aggs": { | |
"total_cost": { | |
"terms": { | |
"field": "type" | |
}, | |
"aggs": { | |
"total_sum": { | |
"sum": { | |
"field": "paidAmount" | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"size": 0, | |
"aggs": { | |
"total_cost": { | |
"terms": { | |
"field": "rType" | |
}, | |
"aggs": { | |
"total_sum": { | |
"sum": { | |
"field": "paidAmount" | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"size": 0, | |
"aggs": { | |
"total_cost": { | |
"terms": { | |
"field": "store", | |
"size": 10, | |
"order": { | |
"total_sum": "desc" | |
} | |
}, | |
"aggs": { | |
"total_sum": { | |
"sum": { | |
"field": "paidAmount" | |
} | |
}, | |
"each": { | |
"terms": { | |
"field": "in", | |
"size": 1 | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"size": 0, | |
"aggs": { | |
"total_cost": { | |
"terms": { | |
"field": "product", | |
"size": 10, | |
"order": { | |
"total_sum": "desc" | |
} | |
}, | |
"aggs": { | |
"total_sum": { | |
"sum": { | |
"field": "paidAmount" | |
} | |
}, | |
"each": { | |
"terms": { | |
"field": "type", | |
"size": 1 | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"size": 0, | |
"aggs": { | |
"calibrationOne": { | |
"terms": { | |
"field": "calibrationOne", | |
"size": 5, | |
"order": { | |
"actual_count": "desc" | |
} | |
}, | |
"aggs": { | |
"actual_count": { | |
"cardinality": { | |
"field": "customerId", | |
"precision_threshold": 5000 | |
} | |
}, | |
"each": { | |
"terms": { | |
"field": "year" | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"size": 0, | |
"aggs": { | |
"calibrationTwo": { | |
"terms": { | |
"field": "calibrationTwo", | |
"size": 5, | |
"order": { | |
"actual_count": "desc" | |
} | |
}, | |
"aggs": { | |
"actual_count": { | |
"cardinality": { | |
"field": "customerId", | |
"precision_threshold": 5000 | |
} | |
}, | |
"each": { | |
"terms": { | |
"field": "year" | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"size": 0, | |
"aggs": { | |
"calibrationThree": { | |
"terms": { | |
"field": "calibrationThree", | |
"size": 5, | |
"order": { | |
"actual_count": "desc" | |
} | |
}, | |
"aggs": { | |
"actual_count": { | |
"cardinality": { | |
"field": "customerId", | |
"precision_threshold": 5000 | |
} | |
}, | |
"each": { | |
"terms": { | |
"field": "year" | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"size": 0, | |
"aggs": { | |
"calibrationFour": { | |
"terms": { | |
"field": "calibrationFour", | |
"size": 5, | |
"order": { | |
"actual_count": "desc" | |
} | |
}, | |
"aggs": { | |
"actual_count": { | |
"cardinality": { | |
"field": "customerId", | |
"precision_threshold": 5000 | |
} | |
}, | |
"each": { | |
"terms": { | |
"field": "year" | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"size": 0, | |
"aggs": { | |
"total_cost": { | |
"terms": { | |
"field": "store", | |
"size": 50, | |
"order": { | |
"total_sum": "desc" | |
} | |
}, | |
"aggs": { | |
"total_sum": { | |
"sum": { | |
"field": "paidAmount" | |
} | |
}, | |
"each": { | |
"terms": { | |
"field": "in" | |
}, | |
"aggs": { | |
"lat": { | |
"terms": { | |
"field": "lat" | |
}, | |
"aggs": { | |
"long": { | |
"terms": { | |
"field": "long" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment