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

版本: 6.8-8.9

简而言之,当 Elasticsearch 在查询中遇到它无法识别或在索引映射中未定义的字段时,会发生此错误。这可能是由于字段名拼写错误或该字段未在索引映射中定义造成的。要解决此问题,您可以检查字段名是否存在拼写错误,确保该字段在索引映射中正确定义,或者如果该字段不需要用于查询或聚合,可以使用 “_source” 字段返回原始文档。

日志上下文 #

日志 “unknown field [{}]” 的类名是 DecayFunctionBuilder.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入理解的人参考:

MultiValueMode mode
 ) throws IOException {
 // the field must exist; else we cannot read the value for the doc later
 MappedFieldType fieldType = context.getFieldType(fieldName);
 if (fieldType == null) {
 throw new ParsingException(parser.getTokenLocation(); "unknown field [{}]"; fieldName);
 }  // dates and time and geo need special handling
 parser.nextToken();
 // TODO these ain't gonna work with runtime fields