# Elasticsearch 6.2 - Composite Bucket Aggregation with Sum Bucket Aggregation and Pipeline Aggregations

**URL:** https://discuss.elastic.co/t/elasticsearch-6-2-composite-bucket-aggregation-with-sum-bucket-aggregation-and-pipeline-aggregations/142658
**Category:** Elasticsearch
**Created:** [August 1, 2018, 11:35pm UTC](https://discuss.elastic.co/t/elasticsearch-6-2-composite-bucket-aggregation-with-sum-bucket-aggregation-and-pipeline-aggregations/142658 "2018-08-01T23:35:01Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![BrobaFett](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@BrobaFett](https://discuss.elastic.co/u/BrobaFett)
#### Post date: [August 2, 2018, 4:56pm UTC](https://discuss.elastic.co/t/elasticsearch-6-2-composite-bucket-aggregation-with-sum-bucket-aggregation-and-pipeline-aggregations/142658/3 "2018-08-02T16:56:27Z")

</div>

Sure, can do.

This is also a simplified recreation of the issue....

My template mapping...

```auto
PUT _template/template_default
{
    "mappings": {
      "_doc": {
        "_all": {
				  "enabled": false
			  },
  			"dynamic": "strict",
  			"properties": {
  				"itemId": {
  				   "type": "keyword",
  				   "norms": false
  				},
  				"inputQty": {
  				   "type": "integer",
  				   "index": false
  				},
  				"orderQty": {
  				   "type": "integer",
  				   "index": false
  				},
  				"centerId": {
  					"type": "keyword",
  					"eager_global_ordinals": true,
  					"norms": false
  				},
  				"submittedQty": {
  					"type": "integer",
  					"index": false
  				},
  				"confirmedQty": {
  					"type": "integer",
  					"index": false
  				}
        }
      }
    }
}

```

My REST call

```auto
POST items-0*/_search?ignore_unavailable=true
{
    "size": 0,
    "track_total_hits": false,
    "aggs" : {
      "myBuckets" : {
        "composite" : {
          "size" : 100000,
          "sources" : [
              { "center_name" : { "terms" : { "field" : "centerId"} } }
            ]
          },
          "aggs" : {
            "requested_units" : { "sum": { "field" : "inputQty" } },
            "approved_units" : { "sum": { "field" : "orderQty" } },
            "submitted_quantity" : { "sum" : { "field" : "submittedQty"} },
            "confirmed_quantity" : { "sum" : { "field" : "confirmedQty"} }
          }
      },
      "check_pipeline_agg": {
        "sum_bucket": {
          "buckets_path": "fc_buckets>requested_units"
        }
      }
    }
}

```

Thanks. I'll link the issue as well when I open it

---

_[View the full topic](https://discuss.elastic.co/t/elasticsearch-6-2-composite-bucket-aggregation-with-sum-bucket-aggregation-and-pipeline-aggregations/142658)._
