# Can I use the aggregation with 'objetc' field?

**URL:** <https://discuss.elastic.co/t/can-i-use-the-aggregation-with-objetc-field/251869>\
**Category:** Elasticsearch\
**Created:** [October 13, 2020, 8:51am UTC](https://discuss.elastic.co/t/can-i-use-the-aggregation-with-objetc-field/251869 "2020-10-13T08:51:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![icaruswu](https://avatars.discourse-cdn.com/v4/letter/i/ebca7d/32.png) [@icaruswu](https://discuss.elastic.co/u/icaruswu)\
**Post date:** [October 13, 2020, 8:51am UTC](https://discuss.elastic.co/t/can-i-use-the-aggregation-with-objetc-field/251869/1 "2020-10-13T08:51:07Z")

</div>

I know that I can use aggreation with keyword type. But I wanna try to deal with some 'object' type in aggregation way. pls follow below:

![2020-10-13 16-38-05 的屏幕截图](https://us1.discourse-cdn.com/elastic/original/3X/8/b/8bb6ce9eec68ea62401ecda5d63ee474777c9757.png)

For this 'ddd' index, I build a 'human' object, then I will insert some 'object' like the person1. person2,person3.... person\* are also belong to object type. Then I need to analyse every person\* 's datas like 'name' and 'age'. ps: Every person object has 'name' and 'age' fields.

How can I use aggregation with 'person\*' ?  
ps: NOT person1.name.keyword, person2.age.keyword...  
And I have to use person\* as 'key' while 'name' and 'age' as 'value', person\* are not allowed to be the same level with 'name' and 'age'... cause my boss demanded.

Could someone can help me or explain to me ? I checked the documents and found that the aggregation is not

---

<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 10, 2020, 9:37am UTC](https://discuss.elastic.co/t/can-i-use-the-aggregation-with-objetc-field/251869/3 "2020-11-10T09:37:23Z")

</div>

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