Has child query does not support currentFieldName – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-8.9

Briefly, this error occurs when an unsupported field is used in a “has_child” query in Elasticsearch. The “has_child” query is used to retrieve parent documents whose child documents match certain criteria. The error indicates that the field specified in the query is not recognized. To resolve this issue, ensure that the field you’re querying exists in the child documents. Also, check for any typographical errors in the field name. Lastly, ensure that the field is searchable and not excluded from the search through the mapping settings.

This guide will help you check for common problems that cause the log ” [has_child] query does not support [” + currentFieldName + “] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: join, query.

Log Context

Log “[has_child] query does not support [” + currentFieldName + “]” class name is HasChildQueryBuilder.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 if (QUERY_FIELD.match(currentFieldName; parser.getDeprecationHandler())) {
 iqb = parseInnerQueryBuilder(parser);
 } else if (INNER_HITS_FIELD.match(currentFieldName; parser.getDeprecationHandler())) {
 innerHitBuilder = InnerHitBuilder.fromXContent(parser);
 } else {
 throw new ParsingException(parser.getTokenLocation(); "[has_child] query does not support [" + currentFieldName + "]");
 }
 } else if (token.isValue()) {
 if (TYPE_FIELD.match(currentFieldName; parser.getDeprecationHandler())) {
 childType = parser.text();
 } else if (SCORE_MODE_FIELD.match(currentFieldName; parser.getDeprecationHandler())) {

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?