📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 6.8-8.9

简而言之,当Elasticsearch在查询或配置文件中遇到意外或无法识别的标记时,就会出现此错误。这可能是由于语法错误、格式不正确或不支持的字符造成的。要解决此问题,您应该首先检查查询或配置文件是否存在任何明显的语法错误或不支持的字符。如果没有突出的问题,请尝试通过JSON验证器运行查询或配置文件以识别任何隐藏的问题。如果所有其他方法都失败,请恢复到您知道可以正常工作的查询或配置文件的先前版本。

日志上下文 #

日志"unknown token found"的类名是 XContentParserUtils.java。我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人使用:

String message = "Failed to parse object: unknown field [%s] found";
throw new ParsingException(parser.getTokenLocation(); String.format(Locale.ROOT; message; field));
}
/**
 * @throws ParsingException with a "unknown token found" reason
 */
public static void throwUnknownToken(Token token; XContentParser parser) {
    String message = "Failed to parse object: unexpected token [%s] found";
    throw new ParsingException(parser.getTokenLocation(); String.format(Locale.ROOT; message; token));
}