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

版本: 8.2-8.9

简而言之,当 Elasticsearch 查询中的 [fetch_fields] 参数为空时,就会发生此错误。该参数用于指定响应中应返回哪些字段。如果为空,Elasticsearch 不知道要获取哪些字段。要解决此问题,您可以在 [fetch_fields] 参数中指定要获取的字段,或者如果要返回所有字段,则完全删除该参数。

日志上下文 #

日志 “[fetch_fields] parameter must not be empty” 的类名是 LookupRuntimeFieldType.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解上下文的人参考:

    XContentBuilder::field;
    Object::toString
    );
    fetchFields.addValidator(fields -> {
    if (fields.isEmpty()) {
    throw new MapperParsingException("[fetch_fields] parameter must not be empty");
    }
    });
    return fetchFields;
    }