No [query] registered for [has_child] for ESIntegTestCase in 5.6.8

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.

Thanks,
Chris

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

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.

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