Skip to content

Instantly share code, notes, and snippets.

Created December 3, 2014 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/e1bcba83fcf564a8ff39 to your computer and use it in GitHub Desktop.
Save anonymous/e1bcba83fcf564a8ff39 to your computer and use it in GitHub Desktop.
[
{
"index": "myrecords",
"type": "eachrecord"
},
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"range": {
"customerId": {
"gte": 10001,
"lt": 14771
}
}
}
]
}
}
}
},
"aggs": {
"total_cost": {
"terms": {
"field": "customerId",
"size": 4770
},
"aggs": {
"total_sum": {
"sum": {
"field": "paidAmount"
}
}
}
}
}
},
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"range": {
"customerId": {
"gte": 14771,
"lt": 19541
}
}
}
]
}
}
}
},
"aggs": {
"total_cost": {
"terms": {
"field": "customerId",
"size": 4770
},
"aggs": {
"total_sum": {
"sum": {
"field": "paidAmount"
}
}
}
}
}
},
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"range": {
"customerId": {
"gte": 19541,
"lt": 24311
}
}
}
]
}
}
}
},
"aggs": {
"total_cost": {
"terms": {
"field": "customerId",
"size": 4770
},
"aggs": {
"total_sum": {
"sum": {
"field": "paidAmount"
}
}
}
}
}
},
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"range": {
"customerId": {
"gte": 24311,
"lt": 29081
}
}
}
]
}
}
}
},
"aggs": {
"total_cost": {
"terms": {
"field": "customerId",
"size": 4770
},
"aggs": {
"total_sum": {
"sum": {
"field": "paidAmount"
}
}
}
}
}
},
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"range": {
"customerId": {
"gte": 29081,
"lt": 33851
}
}
}
]
}
}
}
},
"aggs": {
"total_cost": {
"terms": {
"field": "customerId",
"size": 4770
},
"aggs": {
"total_sum": {
"sum": {
"field": "paidAmount"
}
}
}
}
}
},
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"range": {
"customerId": {
"gte": 33851,
"lt": 38621
}
}
}
]
}
}
}
},
"aggs": {
"total_cost": {
"terms": {
"field": "customerId",
"size": 4770
},
"aggs": {
"total_sum": {
"sum": {
"field": "paidAmount"
}
}
}
}
}
},
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"range": {
"customerId": {
"gte": 38621,
"lt": 43391
}
}
}
]
}
}
}
},
"aggs": {
"total_cost": {
"terms": {
"field": "customerId",
"size": 4770
},
"aggs": {
"total_sum": {
"sum": {
"field": "paidAmount"
}
}
}
}
}
},
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"range": {
"customerId": {
"gte": 43391,
"lt": 48161
}
}
}
]
}
}
}
},
"aggs": {
"total_cost": {
"terms": {
"field": "customerId",
"size": 4770
},
"aggs": {
"total_sum": {
"sum": {
"field": "paidAmount"
}
}
}
}
}
},
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"range": {
"customerId": {
"gte": 48161,
"lt": 52931
}
}
}
]
}
}
}
},
"aggs": {
"total_cost": {
"terms": {
"field": "customerId",
"size": 4770
},
"aggs": {
"total_sum": {
"sum": {
"field": "paidAmount"
}
}
}
}
}
},
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"range": {
"customerId": {
"gte": 52931,
"lt": 57701
}
}
}
]
}
}
}
},
"aggs": {
"total_cost": {
"terms": {
"field": "customerId",
"size": 4770
},
"aggs": {
"total_sum": {
"sum": {
"field": "paidAmount"
}
}
}
}
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment