# Multi - term aggregation with Flat field and nested aggregation

**URL:** <https://discuss.elastic.co/t/multi-term-aggregation-with-flat-field-and-nested-aggregation/284601>\
**Category:** Elasticsearch\
**Created:** [September 20, 2021, 8:20am UTC](https://discuss.elastic.co/t/multi-term-aggregation-with-flat-field-and-nested-aggregation/284601 "2021-09-20T08:20:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Balaji\_Arun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/balaji_arun/32/81040_2.png) [@Balaji\_Arun](https://discuss.elastic.co/u/Balaji_Arun)\
**Post date:** [September 20, 2021, 8:20am UTC](https://discuss.elastic.co/t/multi-term-aggregation-with-flat-field-and-nested-aggregation/284601/1 "2021-09-20T08:20:11Z")

</div>

Hi Guys,  
I just need a multi-term aggregation that has two fields "field1" and "nestedField"

doc structure -

```auto
{
field1:"",
field:{
nestedField:""
}
}

```

But don't know how to construct a query, need your help

Thanks in Advance

---

<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:** [October 18, 2021, 8:21am UTC](https://discuss.elastic.co/t/multi-term-aggregation-with-flat-field-and-nested-aggregation/284601/2 "2021-10-18T08:21:08Z")

</div>

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