# Custom Aggregation Plugin

**URL:** <https://discuss.elastic.co/t/custom-aggregation-plugin/105990>\
**Category:** Elasticsearch\
**Created:** [November 1, 2017, 7:23am UTC](https://discuss.elastic.co/t/custom-aggregation-plugin/105990 "2017-11-01T07:23:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikas\_Kumar1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_kumar1/32/47867_2.png) [@Vikas\_Kumar1](https://discuss.elastic.co/u/Vikas_Kumar1)\
**Post date:** [November 1, 2017, 7:23am UTC](https://discuss.elastic.co/t/custom-aggregation-plugin/105990/1 "2017-11-01T07:23:01Z")

</div>

I want to control how elasticsearch generate aggregations. Like to control the order in which elasticsearch sort buckets. To customize count, calculating count based on score.

How can I do that. I am thinking about to write a plugin to achieve the same. Please guide.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 29, 2017, 7:23am UTC](https://discuss.elastic.co/t/custom-aggregation-plugin/105990/2 "2017-11-29T07:23:11Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
