# Composite aggregation Pattern Support

**URL:** https://discuss.elastic.co/t/composite-aggregation-pattern-support/183487
**Category:** Elasticsearch
**Created:** [May 30, 2019, 8:45am UTC](https://discuss.elastic.co/t/composite-aggregation-pattern-support/183487 "2019-05-30T08:45:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sakshi\_Srivastava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sakshi_srivastava/32/45707_2.png) [@Sakshi\_Srivastava](https://discuss.elastic.co/u/Sakshi_Srivastava)
#### Post date: [May 30, 2019, 8:45am UTC](https://discuss.elastic.co/t/composite-aggregation-pattern-support/183487/1 "2019-05-30T08:45:39Z")

</div>

I want to get documents of a particular pattern in my aggregation. If I use termsAggregation then I can use "include" to mark a pattern but this is not the case with composite aggregation. I need use something like include to get all the documents of a particular pattern in composite aggregation. AfterKey doesn't work here because it doesn't support pattern only hard values. Could you please help me?

---

<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: [June 27, 2019, 8:45am UTC](https://discuss.elastic.co/t/composite-aggregation-pattern-support/183487/2 "2019-06-27T08:45:44Z")

</div>

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