Mlt 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 a More Like This (mlt) query in Elasticsearch is used with a field that it does not support. The “currentFieldName” is the unsupported field. To resolve this issue, you can either remove the unsupported field from the query or replace it with a field that is supported by the mlt query. Additionally, ensure that the field exists in your index and that it is correctly mapped. Lastly, check the Elasticsearch version you’re using, as some fields may not be supported in older versions.

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

 } else if ("boost".equals(currentFieldName)) {
 boost = parser.floatValue();
 } else if ("_name".equals(currentFieldName)) {
 queryName = parser.text();
 } else {
 throw new ParsingException(parser.getTokenLocation(); "[mlt] query does not support [" + currentFieldName + "]");
 }
 } else if (token == XContentParser.Token.START_ARRAY) {
 if (FIELDS.match(currentFieldName; parser.getDeprecationHandler())) {
 fields = new ArrayList<>();
 while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {

 

 [ratemypost]

Opster
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.