Span within 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 [span_within] query in Elasticsearch. The [span_within] query only supports “big” and “little” fields. If you use any other field, this error will be thrown. To resolve this issue, you should review your query and ensure that only supported fields are used. If you’re trying to use a feature not supported by [span_within], consider using a different type of query that supports the desired functionality.

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

Log Context

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

 } else if (AbstractQueryBuilder.BOOST_FIELD.match(currentFieldName; parser.getDeprecationHandler())) {
 boost = parser.floatValue();
 } else if (AbstractQueryBuilder.NAME_FIELD.match(currentFieldName; parser.getDeprecationHandler())) {
 queryName = parser.text();
 } else {
 throw new ParsingException(parser.getTokenLocation(); "[span_within] query does not support [" + currentFieldName + "]");
 }
 }  if (big == null) {
 throw new ParsingException(parser.getTokenLocation(); "span_within must include [big]");

 

 [ratemypost]