# Has\_parent not working for me

**URL:** <https://discuss.elastic.co/t/has-parent-not-working-for-me/11235>\
**Category:** Elasticsearch\
**Created:** [March 21, 2013, 12:45pm UTC](https://discuss.elastic.co/t/has-parent-not-working-for-me/11235 "2013-03-21T12:45:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![q42jaap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/q42jaap/32/2241_2.png) [@q42jaap](https://discuss.elastic.co/u/q42jaap)\
**Post date:** [March 21, 2013, 12:45pm UTC](https://discuss.elastic.co/t/has-parent-not-working-for-me/11235/1 "2013-03-21T12:45:21Z")

</div>

I'm probably doing something wrong, but I can't figure out what!

Index and query script  
[http://pastebin.com/vjLREEzE](http://pastebin.com/vjLREEzE)

Results  
[http://pastebin.com/C7ypv4uX](http://pastebin.com/C7ypv4uX)

I was expecting the second query to list the book id=2 : 'Guns and lasers'.  
Can somebody help me out?

Tested on 0.90.0-Beta1

--  
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:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 21, 2013, 3:50pm UTC](https://discuss.elastic.co/t/has-parent-not-working-for-me/11235/2 "2013-03-21T15:50:07Z")

</div>

> [query books script - Pastebin.com](http://pastebin.com/vjLREEzE)

> I was expecting the second query to list the book id=2 : 'Guns and  
> lasers'. Can somebody help me out?

Your query is querying type 'books', but the type is actually 'book'

clint

--  
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:** ![q42jaap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/q42jaap/32/2241_2.png) [@q42jaap](https://discuss.elastic.co/u/q42jaap)\
**Post date:** [March 21, 2013, 4:09pm UTC](https://discuss.elastic.co/t/has-parent-not-working-for-me/11235/3 "2013-03-21T16:09:58Z")

</div>

I know I was being _really_ stupid! Thanks!  
Jaap Taal

[Q42 BV | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
Waldorpstraat 17F, Den Haag | Vijzelstraat 72 unit 4.23, Amsterdam |  
KvK 30164662 ]

On Thu, Mar 21, 2013 at 4:50 PM, Clinton Gormley [clint@traveljury.com](mailto:clint@traveljury.com) wrote:

> > [query books script - Pastebin.com](http://pastebin.com/vjLREEzE)
> 
> > I was expecting the second query to list the book id=2 : 'Guns and  
> > lasers'. Can somebody help me out?
> 
> Your query is querying type 'books', but the type is actually 'book'
> 
> clint
> 
> --  
> 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).

--  
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:45am UTC](https://discuss.elastic.co/t/has-parent-not-working-for-me/11235/4 "2017-07-06T02:45:19Z")

</div>


