Span near 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_near] query in Elasticsearch. The [span_near] query is used to match spans which are near one another, and it only supports specific fields. The error indicates that the field [” + currentFieldName + “] is not supported. To resolve this issue, you should check the Elasticsearch documentation to understand which fields are supported by the [span_near] query. Then, modify your query to only use supported fields. If the field is necessary for your search, consider using a different type of query that supports it.

This guide will help you check for common problems that cause the log ” [span_near] 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_near] query does not support [” + currentFieldName + “]” class name is SpanNearQueryBuilder.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 final SpanQueryBuilder clause = (SpanQueryBuilder) query;
 checkNoBoost(NAME; currentFieldName; parser; clause);
 clauses.add(clause);
 }
 } else {
 throw new ParsingException(parser.getTokenLocation(); "[span_near] query does not support [" + currentFieldName + "]");
 }
 } else if (token.isValue()) {
 if (IN_ORDER_FIELD.match(currentFieldName; parser.getDeprecationHandler())) {
 inOrder = parser.booleanValue();
 } else if (SLOP_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?