版本: 6.8-8.9
简而言之,当你在 Elasticsearch Suggestion API 中尝试使用一个不被支持的字段时,就会发生此错误。导致问题的字段名由 “currentFieldName” 表示。要解决这个问题,请确保你尝试使用的字段是 Suggestion API 所支持的。你可能需要修改查询以使用不同的字段,或者调整索引映射以使该字段与 Suggestion API 兼容。此外,还要检查查询中是否存在拼写错误或错误的字段名。
日志上下文 #
日志 “suggestion does not support [” + currentFieldName + “]” 的类名是 SuggestionBuilder.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入背景信息的人参考:
} else if (PREFIX_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
prefix = parser.text();
} else if (REGEX_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
regex = parser.text();
} else {
throw new ParsingException(parser.getTokenLocation(), "suggestion does not support [" + currentFieldName + "]");
}
} else if (token == XContentParser.Token.START_OBJECT) {
suggestionBuilder = parser.namedObject(SuggestionBuilder.class, currentFieldName, null);
}
}





