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

版本: 6.8-7.15

简而言之,当在Elasticsearch上启用字段级或文档级安全时尝试执行更新请求,就会出现此错误。此安全功能限制对某些字段或文档的访问,因此更新请求失败。要解决此问题,如果字段级或文档级安全不是必需的,可以将其禁用,或者修改安全设置以允许对特定字段或文档执行更新操作。另一种方法是使用更新后的数据执行重建索引操作,从而绕过更新请求的需求。

日志上下文 #


日志 “Can’t execute an update request if field or document level security” 的类名是 UpdateRequestInterceptor.java。我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人参考:

@Override
 void disableFeatures(IndicesRequest indicesRequest;
 MapindicesAccessControlByIndex;
 ActionListenerlistener) {
 listener.onFailure(new ElasticsearchSecurityException("Can't execute an update request if field or document level security " +
 "is enabled"; RestStatus.BAD_REQUEST));
 }  @Override
 String[] requestIndices(IndicesRequest indicesRequest) {