Method: projects.locations.dataStores.branches.documents.purge

永久删除分支中的所有选定 Document

此过程是异步的。此操作可能需要数小时才能完成,具体取决于要删除的 Document 数量。在删除操作完成之前,DocumentService.GetDocumentDocumentService.ListDocuments 可能会继续返回一些 Document

如需获取要删除的 Document 列表,请将 PurgeDocumentsRequest.force 设置为 false。

HTTP 请求

POST https://discoveryengine.googleapis.com/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge

网址采用 gRPC 转码语法。

路径参数

参数
parent

string

必需。父级资源名称,例如 projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/branches/{branch}

请求正文

请求正文中包含结构如下的数据:

JSON 表示法
{
  "filter": string,
  "errorConfig": {
    object (PurgeErrorConfig)
  },
  "force": boolean,

  // Union field source can be only one of the following:
  "gcsSource": {
    object (GcsSource)
  },
  "inlineSource": {
    object (InlineSource)
  }
  // End of list of possible types for union field source.
}
字段
filter

string

必需。过滤要清除的匹配文档。目前唯一支持的值是 *(所有商品)。

errorConfig

object (PurgeErrorConfig)

在清除期间发生的错误的预期位置。

force

boolean

实际执行清除操作。如果 force 设置为 false,则返回预期的完全清除计数,但不删除任何文档。

联合字段 source。用于根据文档 ID 清除文档的所需输入源。source 只能是下列其中一项:
gcsSource

object (GcsSource)

输入内容所在的 Cloud Storage 位置。支持的 dataSchema:* documentId:每行一个有效的 Document.id

inlineSource

object (InlineSource)

用于清除的输入内容的内嵌来源。

响应正文

如果成功,则响应正文包含一个 Operation 实例。

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.readwrite

如需了解详情,请参阅 Authentication Overview

IAM 权限

需要拥有 parent 资源的以下 IAM 权限:

  • discoveryengine.documents.purge

如需了解详情,请参阅 IAM 文档