# Has\_parent 0.90.1 grandchild issue

**URL:** <https://discuss.elastic.co/t/has-parent-0-90-1-grandchild-issue/12257>\
**Category:** Elasticsearch\
**Created:** [June 4, 2013, 1:27pm UTC](https://discuss.elastic.co/t/has-parent-0-90-1-grandchild-issue/12257 "2013-06-04T13:27:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbong](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jbong](https://discuss.elastic.co/u/jbong)\
**Post date:** [June 4, 2013, 1:27pm UTC](https://discuss.elastic.co/t/has-parent-0-90-1-grandchild-issue/12257/1 "2013-06-04T13:27:37Z")

</div>

Hi folks

I believe there is an issue with grandchild type mapping in version 0.90.1.  
By 'grandchild' i am referring to mappings which are related to each other  
in the form of 'GrandParent' \> 'Parent' \> 'Child'. Put simply in 0.90.1 if  
the 'Child' mapping is defined any query against the 'Parent' which uses a  
has\_parent query will fail to return any results. In version 0.90.0 the  
query returns a result as expected.

Gist to reproduce: [https://gist.github.com/jbong/5705764](https://gist.github.com/jbong/5705764)

Note that adding a document to the 'Child' type is not necessary to  
reproduce the problem, simply adding it as a mapping seems to prevent a  
query against the 'Parent', which includes has\_parent, from returning any  
results.

Any help much appreciated

jb

--  
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:** [June 5, 2013, 6:03pm UTC](https://discuss.elastic.co/t/has-parent-0-90-1-grandchild-issue/12257/2 "2013-06-05T18:03:23Z")

</div>

Hi jb,

This is a bug. I'll open an issue shortly for this. Thanks for bringing  
this up!

Martijn

On 4 June 2013 15:27, jbong [jeremy@egrove.co.uk](mailto:jeremy@egrove.co.uk) wrote:

> Hi folks
> 
> I believe there is an issue with grandchild type mapping in version  
> 0.90.1. By 'grandchild' i am referring to mappings which are related to  
> each other in the form of 'GrandParent' \> 'Parent' \> 'Child'. Put simply in  
> 0.90.1 if the 'Child' mapping is defined any query against the 'Parent'  
> which uses a has\_parent query will fail to return any results. In version  
> 0.90.0 the query returns a result as expected.
> 
> Gist to reproduce: [elasticsearch grandparent issue 0.90.1 · GitHub](https://gist.github.com/jbong/5705764)
> 
> Note that adding a document to the 'Child' type is not necessary to  
> reproduce the problem, simply adding it as a mapping seems to prevent a  
> query against the 'Parent', which includes has\_parent, from returning any  
> results.
> 
> Any help much appreciated
> 
> jb
> 
> --  
> 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:** ![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:** [June 5, 2013, 8:09pm UTC](https://discuss.elastic.co/t/has-parent-0-90-1-grandchild-issue/12257/3 "2013-06-05T20:09:25Z")

</div>

Btw: I have created the following issue:

> <https://github.com/elastic/elasticsearch/issues/3139>
>
> Reported via the ML: 
> https://groups.google.com/forum/?fromgroups#!topic/elastic…search/gto9da4fq3M
> 
> In short: 
> With types the grand\_parent, parent, child
> Then the \`has\_parent\` query and filter can't find any docs if parent\_type is set to parent.
> 
> For example when the following query is executed: 
> 
> \`\`\`
> "has\_parent" : {
> "type" : "parent",
> "query" : match\_all : {}
> }
> \`\`\`
> 
> Then no results are returned.

On 5 June 2013 20:03, Martijn v Groningen [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)wrote:

> Hi jb,
> 
> This is a bug. I'll open an issue shortly for this. Thanks for bringing  
> this up!
> 
> Martijn
> 
> On 4 June 2013 15:27, jbong [jeremy@egrove.co.uk](mailto:jeremy@egrove.co.uk) wrote:
> 
> > Hi folks
> > 
> > I believe there is an issue with grandchild type mapping in version  
> > 0.90.1. By 'grandchild' i am referring to mappings which are related to  
> > each other in the form of 'GrandParent' \> 'Parent' \> 'Child'. Put simply in  
> > 0.90.1 if the 'Child' mapping is defined any query against the 'Parent'  
> > which uses a has\_parent query will fail to return any results. In version  
> > 0.90.0 the query returns a result as expected.
> > 
> > Gist to reproduce: [elasticsearch grandparent issue 0.90.1 · GitHub](https://gist.github.com/jbong/5705764)
> > 
> > Note that adding a document to the 'Child' type is not necessary to  
> > reproduce the problem, simply adding it as a mapping seems to prevent a  
> > query against the 'Parent', which includes has\_parent, from returning any  
> > results.
> > 
> > Any help much appreciated
> > 
> > jb
> > 
> > --  
> > 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

--  
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:** ![jbong](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jbong](https://discuss.elastic.co/u/jbong)\
**Post date:** [June 6, 2013, 9:03am UTC](https://discuss.elastic.co/t/has-parent-0-90-1-grandchild-issue/12257/4 "2013-06-06T09:03:39Z")

</div>

Awesome..thank you for the quick reply Martijn 😉

On Wednesday, June 5, 2013 9:09:25 PM UTC+1, Martijn v Groningen wrote:

> Btw: I have created the following issue:  
> [has\_parent query returning no results with multi level child docs. · Issue #3139 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/3139)
> 
> On 5 June 2013 20:03, Martijn v Groningen \<[martijn.v...@gmail.com](mailto:martijn.v...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hi jb,
> > 
> > This is a bug. I'll open an issue shortly for this. Thanks for bringing  
> > this up!
> > 
> > Martijn
> > 
> > On 4 June 2013 15:27, jbong \<[jer...@egrove.co.uk](mailto:jer...@egrove.co.uk) \<javascript:\>\> wrote:
> > 
> > > Hi folks
> > > 
> > > I believe there is an issue with grandchild type mapping in version  
> > > 0.90.1. By 'grandchild' i am referring to mappings which are related to  
> > > each other in the form of 'GrandParent' \> 'Parent' \> 'Child'. Put simply in  
> > > 0.90.1 if the 'Child' mapping is defined any query against the 'Parent'  
> > > which uses a has\_parent query will fail to return any results. In version  
> > > 0.90.0 the query returns a result as expected.
> > > 
> > > Gist to reproduce: [elasticsearch grandparent issue 0.90.1 · GitHub](https://gist.github.com/jbong/5705764)
> > > 
> > > Note that adding a document to the 'Child' type is not necessary to  
> > > reproduce the problem, simply adding it as a mapping seems to prevent a  
> > > query against the 'Parent', which includes has\_parent, from returning any  
> > > results.
> > > 
> > > Any help much appreciated
> > > 
> > > jb
> > > 
> > > --  
> > > 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
> 
> --  
> 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:32am UTC](https://discuss.elastic.co/t/has-parent-0-90-1-grandchild-issue/12257/5 "2017-07-06T02:32:38Z")

</div>

Closed on July 6, 2017, 2:32am UTC


