# Unknown NamedWriteable \[org.elasticsearch.index.query.QueryBuilder\]\[has\_child\] using ESIntegTestCase

**URL:** <https://discuss.elastic.co/t/unknown-namedwriteable-org-elasticsearch-index-query-querybuilder-has-child-using-esintegtestcase/112998>\
**Category:** Elasticsearch\
**Created:** [December 22, 2017, 12:48pm UTC](https://discuss.elastic.co/t/unknown-namedwriteable-org-elasticsearch-index-query-querybuilder-has-child-using-esintegtestcase/112998 "2017-12-22T12:48:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaughnd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vaughnd/32/13671_2.png) [@vaughnd](https://discuss.elastic.co/u/vaughnd)\
**Post date:** [December 22, 2017, 12:48pm UTC](https://discuss.elastic.co/t/unknown-namedwriteable-org-elasticsearch-index-query-querybuilder-has-child-using-esintegtestcase/112998/1 "2017-12-22T12:48:13Z")

</div>

Hi,

I'm using ESIntegTestCase to do some integration tests, most work fine, but as soon as I try to use a has\_child query it bombs with "Caused by: java.lang.IllegalArgumentException: Unknown NamedWriteable [org.elasticsearch.index.query.QueryBuilder][has\_child]".

I'm just using this addition to the main query and then it bombs, but it works fine without it:  
InnerHitBuilder innerHitbuilder = new InnerHitBuilder().setName(typeMapping.getTypeName())  
queryBuilder = JoinQueryBuilders.hasChildQuery("page", queryBuilder, ScoreMode.Max).innerHit(innerHitbuilder)

I'm in the middle of a large refactor from ES 2.4 to 5.6, so I've probably broken the query in an interesting way.

Any help will be much appreciated!

Full stack trace here: [https://gist.github.com/vaughnd/228885aec3b69d8107aa1c6a4dfdc62e](https://gist.github.com/vaughnd/228885aec3b69d8107aa1c6a4dfdc62e)

Cheers,  
Vaughn

---

<div class="post-metadata">

**Author:** ![vaughnd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vaughnd/32/13671_2.png) [@vaughnd](https://discuss.elastic.co/u/vaughnd)\
**Post date:** [December 22, 2017, 2:00pm UTC](https://discuss.elastic.co/t/unknown-namedwriteable-org-elasticsearch-index-query-querybuilder-has-child-using-esintegtestcase/112998/2 "2017-12-22T14:00:33Z")

</div>

After hunting around in the ES source code I found the solution. Turns out there is a ParentJoinPlugin.class that needs to be included.

---

<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:** [January 19, 2018, 2:00pm UTC](https://discuss.elastic.co/t/unknown-namedwriteable-org-elasticsearch-index-query-querybuilder-has-child-using-esintegtestcase/112998/3 "2018-01-19T14:00:57Z")

</div>

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