# Problem with Grandparent/Parent/Child

**URL:** <https://discuss.elastic.co/t/problem-with-grandparent-parent-child/13817>\
**Category:** Elasticsearch\
**Created:** [October 1, 2013, 2:34pm UTC](https://discuss.elastic.co/t/problem-with-grandparent-parent-child/13817 "2013-10-01T14:34:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erling\_Wegger\_Linde](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erling_wegger_linde/32/2070_2.png) [@Erling\_Wegger\_Linde](https://discuss.elastic.co/u/Erling_Wegger_Linde)\
**Post date:** [October 1, 2013, 2:34pm UTC](https://discuss.elastic.co/t/problem-with-grandparent-parent-child/13817/1 "2013-10-01T14:34:39Z")

</div>

Hi,

I've got an issue where the type field seems to be ignored for the child  
document, ES (0.90.2) seems to return matches as long as any of it's child  
documents (regardless of type) has a match in a field with the same name.  
Please see the following gist: [https://gist.github.com/erlingwl/6779401](https://gist.github.com/erlingwl/6779401) Am  
I missing something here? Is this a bug or is there some kind of workaround  
I could use?

Thanks,  
Erling

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [October 1, 2013, 9:57pm UTC](https://discuss.elastic.co/t/problem-with-grandparent-parent-child/13817/2 "2013-10-01T21:57:36Z")

</div>

Hi Erling,

I see the same issue, the second search request shouldn't have any matches.  
This seems like a bug, can you open an issue for it?

Martijn

On 1 October 2013 16:34, Erling Wegger Linde [erlingwl@gmail.com](mailto:erlingwl@gmail.com) wrote:

> Hi,
> 
> I've got an issue where the type field seems to be ignored for the child  
> document, ES (0.90.2) seems to return matches as long as any of it's child  
> documents (regardless of type) has a match in a field with the same name.  
> Please see the following gist: [Grandchild bug ES 0.90.2 · GitHub](https://gist.github.com/erlingwl/6779401) Am  
> I missing something here? Is this a bug or is there some kind of workaround  
> I could use?
> 
> Thanks,  
> Erling
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Erling\_Wegger\_Linde](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erling_wegger_linde/32/2070_2.png) [@Erling\_Wegger\_Linde](https://discuss.elastic.co/u/Erling_Wegger_Linde)\
**Post date:** [October 2, 2013, 10:33am UTC](https://discuss.elastic.co/t/problem-with-grandparent-parent-child/13817/3 "2013-10-02T10:33:32Z")

</div>

Thanks Martijn, I opened the following  
issue: [has\_child ignores type field for Grandparent/Parent/Child query · Issue #3818 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/3818)

Erling

On Tuesday, 1 October 2013 23:57:36 UTC+2, Martijn v Groningen wrote:

> Hi Erling,
> 
> I see the same issue, the second search request shouldn't have any  
> matches. This seems like a bug, can you open an issue for it?
> 
> Martijn
> 
> On 1 October 2013 16:34, Erling Wegger Linde \<[erli...@gmail.com](mailto:erli...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hi,
> > 
> > I've got an issue where the type field seems to be ignored for the child  
> > document, ES (0.90.2) seems to return matches as long as any of it's child  
> > documents (regardless of type) has a match in a field with the same name.  
> > Please see the following gist: [Grandchild bug ES 0.90.2 · GitHub](https://gist.github.com/erlingwl/6779401) Am  
> > I missing something here? Is this a bug or is there some kind of workaround  
> > I could use?
> > 
> > Thanks,  
> > Erling
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Met vriendelijke groet,
> 
> Martijn van Groningen

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:14am UTC](https://discuss.elastic.co/t/problem-with-grandparent-parent-child/13817/4 "2017-07-06T02:14:02Z")

</div>


