# Custom Aggregations in ES

**URL:** <https://discuss.elastic.co/t/custom-aggregations-in-es/311385>\
**Category:** Elasticsearch\
**Created:** [August 4, 2022, 8:38am UTC](https://discuss.elastic.co/t/custom-aggregations-in-es/311385 "2022-08-04T08:38:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![79g](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/79g/32/109191_2.png) [@79g](https://discuss.elastic.co/u/79g)\
**Post date:** [August 4, 2022, 8:50am UTC](https://discuss.elastic.co/t/custom-aggregations-in-es/311385/2 "2022-08-04T08:50:26Z")

</div>

Hello,

please could you check [Sum by quantity and sort by lowest price - #2 by 79g](https://discuss.elastic.co/t/sum-by-quantity-and-sort-by-lowest-price/311242/2) ?

The query is almost the same, with an average as agg

```auto
"aggs": {
    "aggScore": {
      "avg": {
        "field": "score"
      }
    }
}

```

Hope it helps!

---

_[View the full topic](https://discuss.elastic.co/t/custom-aggregations-in-es/311385)._
