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

Opster Team

August-23, Version: 6.8-7.6

Briefly, this error occurs when an unsupported field is used in a boolean query in Elasticsearch. The field specified in the error message is not recognized by Elasticsearch. To resolve this issue, you should first verify the field name in your query. Make sure it matches exactly with the field name in your Elasticsearch index, including case sensitivity. If the field name is correct, check the Elasticsearch version you’re using. Some fields are version-specific. 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 ” [bool] query does not support [” + currentFieldName + “] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index, query.

Log Context

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

 case MUST_NOT:
 case MUSTNOT:
 mustNotClauses.add(parseInnerQueryBuilder(parser));
 break;
 default:
 throw new ParsingException(parser.getTokenLocation(); "[bool] query does not support [" + currentFieldName + "]");
 }
 } else if (token == XContentParser.Token.START_ARRAY) {
 while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {
 switch (currentFieldName) {
 case MUST:

 

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?