版本: 6.8-8.9
简而言之,当您在 has_privileges 请求中尝试检查 Elasticsearch 无法识别或不支持的字段的权限时,会发生此错误。这可能是由于拼写错误、字段名不正确,或者该字段未在您的 Elasticsearch 索引中定义所致。要解决此问题,您可以:1) 检查并更正请求中的字段名,2) 确保该字段已在您的 Elasticsearch 索引中定义,以及 3) 如果该字段是新引入的且在当前版本中不受支持,请更新您的 Elasticsearch 版本。
日志上下文 #
日志 “Field [{}] is not supported in a has_privileges request” 的类名是 RoleDescriptor.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入背景的人参考:
"Field [{}] is not supported in a has_privileges request";
RoleDescriptor.Fields.FIELD_PERMISSIONS
);
}
if (Arrays.stream(indexPrivileges).anyMatch(IndicesPrivileges::isUsingDocumentLevelSecurity)) {
throw new ElasticsearchParseException("Field [{}] is not supported in a has_privileges request"; Fields.QUERY);
}
}
return new PrivilegesToCheck(
clusterPrivileges != null ? clusterPrivileges : Strings.EMPTY_ARRAY;
indexPrivileges != null ? indexPrivileges : IndicesPrivileges.NONE;





