# Hash Child Query does not work when using with Child item v: 5.6

**URL:** https://discuss.elastic.co/t/hash-child-query-does-not-work-when-using-with-child-item-v-5-6/114656
**Category:** Elasticsearch
**Created:** [January 9, 2018, 7:51am UTC](https://discuss.elastic.co/t/hash-child-query-does-not-work-when-using-with-child-item-v-5-6/114656 "2018-01-09T07:51:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![arifemre61](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arifemre61/32/26374_2.png) [@arifemre61](https://discuss.elastic.co/u/arifemre61)
#### Post date: [January 9, 2018, 7:51am UTC](https://discuss.elastic.co/t/hash-child-query-does-not-work-when-using-with-child-item-v-5-6/114656/1 "2018-01-09T07:51:34Z")

</div>

Hi All,

I am using parent-child relationship in Elasticsearch 5.6 cluster

İn my case I have a tree like

Post (an object)  
Comment (comments of an object)  
CommentBlock (blocked users of a comment)

I don't want to get blocked comments by user when I search the comments

in nest I am using this query;

& q.Bool(b =\> b.MustNot(m =\> m.HasChild(hs =\> hs.Query(qq =\> qq.Term(tt =\> tt.MemberId, MemberId))))))

this query did not work.

When I write has child query for a parent it is ok but  
When I write has child query for a child ( child of child) i does not work

Thanks for your helps

---

<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: [February 6, 2018, 7:51am UTC](https://discuss.elastic.co/t/hash-child-query-does-not-work-when-using-with-child-item-v-5-6/114656/2 "2018-02-06T07:51:44Z")

</div>

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