# No \[query\] registered for \[has\_child\] for ESIntegTestCase in 5.6.8

**URL:** <https://discuss.elastic.co/t/no-query-registered-for-has-child-for-esintegtestcase-in-5-6-8/185262>\
**Category:** Elasticsearch\
**Created:** [June 11, 2019, 6:38pm UTC](https://discuss.elastic.co/t/no-query-registered-for-has-child-for-esintegtestcase-in-5-6-8/185262 "2019-06-11T18:38:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_H1](https://avatars.discourse-cdn.com/v4/letter/c/a9adbd/32.png) [@Chris\_H1](https://discuss.elastic.co/u/Chris_H1)\
**Post date:** [June 11, 2019, 6:38pm UTC](https://discuss.elastic.co/t/no-query-registered-for-has-child-for-esintegtestcase-in-5-6-8/185262/1 "2019-06-11T18:38:51Z")

</div>

We have integration tests set up using the ESIntegTestCase, in upgrading to 5.6.8 from 5.1.2 all of our has\_child queries get the following errors:  
`{"error":{"root_cause":[{"type":"parsing_exception","reason":"no [query] registered for [has_child]","line":1,"col":40}],"type":"parsing_exception","reason":"no [query] registered for [has_child]","line":1,"col":40},"status":400}`

Here is an example query. The query is successful against our es 5.6.8 server:  
`{"query":{"bool":{"must":[{"has_child":{"query":{"bool":{"must":[{"term":{"value":{"value":"cat","boost":1.0}}}],"filter":[{"term":{"name":{"value":"title","boost":1.0}}}],"disable_coord":false,"adjust_pure_negative":true,"boost":1.0}},"type":"field","score_mode":"none","min_children":0,"max_children":2147483647,"ignore_unmapped":false,"boost":1.0}}],"filter":[{"type":{"value":"main","boost":1.0}}],"disable_coord":false,"adjust_pure_negative":true,"boost":1.0}},"size":1000,"sort":["_uid"]}`

I've found this similar forum post, but I'm pretty sure the proposed fix was to use ESIntegTestCase.

> [@Parse Exception while executing has\_child query in Embedded Elastic Search Server](https://discuss.elastic.co/t/parse-exception-while-executing-has-child-query-in-embedded-elastic-search-server/138977/4):
>
> To run integration tests (not unit tests) you would probably prefer running that in something close to a production environment, like a real elasticsearch server instance. I shared some ideas about integration testing in this thread: [In memory testing with RestHighLevelClient](https://discuss.elastic.co/t/in-memory-testing-with-resthighlevelclient/106196/6) Also this sample project shows how to use Elasticsearch Test Classes:

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 13, 2019, 7:16am UTC](https://discuss.elastic.co/t/no-query-registered-for-has-child-for-esintegtestcase-in-5-6-8/185262/2 "2019-06-13T07:16:21Z")

</div>

The `parent-join` functionality is implemented as a module and thus not provided as part of the ESIntegTestCase.

See [https://github.com/elastic/elasticsearch/tree/master/modules/parent-join](https://github.com/elastic/elasticsearch/tree/master/modules/parent-join)

---

<div class="post-metadata">

**Author:** ![Chris\_H1](https://avatars.discourse-cdn.com/v4/letter/c/a9adbd/32.png) [@Chris\_H1](https://discuss.elastic.co/u/Chris_H1)\
**Post date:** [June 13, 2019, 5:19pm UTC](https://discuss.elastic.co/t/no-query-registered-for-has-child-for-esintegtestcase-in-5-6-8/185262/3 "2019-06-13T17:19:02Z")

</div>

Thanks for the answer, I made some progress.  
I added ParentJoinPlugin.class to my nodePlugins in my test case, like so:

```
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
    return Arrays.asList(C3POPlugin.class, Netty4Plugin.class, ParentJoinPlugin.class);
}

```

Now the test cases run. I don't understand why there isn't a similar process to install ParentJoinPlugin so my server will understand has\_child queries?

I have one more question. I made this work, but I don't think i'm doing it right. My plugin uses the HasChildQueryBuilder class. I get a no-class-definition error when running in 5.6.8.

I fixed this by adding parent-join-client.jar to my plugin.zip.  
This worked and all errors went away, but I don't think this is the correct way to add this jar.

---

<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 11, 2019, 5:19pm UTC](https://discuss.elastic.co/t/no-query-registered-for-has-child-for-esintegtestcase-in-5-6-8/185262/4 "2019-07-11T17:19:10Z")

</div>

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