# Differentiate type of child for aggregation

**URL:** <https://discuss.elastic.co/t/differentiate-type-of-child-for-aggregation/141345>\
**Category:** Elasticsearch\
**Created:** [July 24, 2018, 9:55am UTC](https://discuss.elastic.co/t/differentiate-type-of-child-for-aggregation/141345 "2018-07-24T09:55:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guillaume\_Abautret](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@Guillaume\_Abautret](https://discuss.elastic.co/u/Guillaume_Abautret)\
**Post date:** [July 24, 2018, 9:55am UTC](https://discuss.elastic.co/t/differentiate-type-of-child-for-aggregation/141345/1 "2018-07-24T09:55:10Z")

</div>

Hi all,  
I have an issue that i can not resolved by myself. I have a parent (called "user") and children (called visit\_competitor and visit\_direct). Each user have an id and can have lot of visits (competitor and direct). I need to dissociate user who have only visit\_direct, or only visit\_competitor, or both. How can I do this?

Thank you!

---

<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:** [August 21, 2018, 9:55am UTC](https://discuss.elastic.co/t/differentiate-type-of-child-for-aggregation/141345/2 "2018-08-21T09:55:11Z")

</div>

Closed on August 21, 2018, 9:55am UTC

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