Method: indexing.datasources.items.index

更新 Item ACL、元数据和内容。如果 Item 不存在,则执行插入操作。此方法不支持部分更新。未提供值的字段会在 Cloud Search 索引中清除。

此 API 需要管理员或服务帐号才能执行。使用的服务帐号是相应数据源中列入白名单的服务帐号。

HTTP 请求

POST https://cloudsearch.googleapis.com/v1/indexing/{item.name=datasources/*/items/*}:index

网址采用 gRPC 转码语法。

路径参数

参数
item.name

string

商品的名称。格式:datasources/{sourceId}/items/{itemId}

这是必填字段。长度上限为 1536 个字符。

请求正文

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

JSON 表示法
{
  "item": {
    "name": string,
    "acl": {
      "inheritAclFrom": string,
      "aclInheritanceType": enum (ItemAcl.AclInheritanceType),
      "readers": [
        {
          object (Principal)
        }
      ],
      "deniedReaders": [
        {
          object (Principal)
        }
      ],
      "owners": [
        {
          object (Principal)
        }
      ]
    },
    "metadata": {
      "title": string,
      "sourceRepositoryUrl": string,
      "containerName": string,
      "objectType": string,
      "createTime": string,
      "updateTime": string,
      "interactions": [
        {
          object (Interaction)
        }
      ],
      "contentLanguage": string,
      "mimeType": string,
      "searchQualityMetadata": {
        object (SearchQualityMetadata)
      },
      "keywords": [
        string
      ],
      "hash": string,
      "contextAttributes": [
        {
          object (ContextAttribute)
        }
      ]
    },
    "structuredData": {
      "object": {
        object (StructuredDataObject)
      },
      "hash": string
    },
    "content": {
      "contentFormat": enum (ItemContent.ContentFormat),
      "hash": string,

      // Union field content can be only one of the following:
      "inlineContent": string,
      "contentDataRef": {
        object (UploadItemRef)
      }
      // End of list of possible types for union field content.
    },
    "version": string,
    "status": {
      "code": enum (ItemStatus.Code),
      "processingErrors": [
        {
          object (ProcessingError)
        }
      ],
      "repositoryErrors": [
        {
          object (RepositoryError)
        }
      ]
    },
    "queue": string,
    "payload": string,
    "itemType": enum (Item.ItemType)
  },
  "connectorName": string,
  "mode": enum (RequestMode.Mode),
  "debugOptions": {
    object (DebugOptions)
  },
  "indexItemOptions": {
    object (IndexItemOptions)
  }
}
字段
item.acl

object (ItemAcl)

此项的访问权限控制列表。

item.metadata

object (ItemMetadata)

元数据信息。

item.structuredData

object (ItemStructuredData)

项的结构化数据,这些数据应与数据源架构中已注册的对象定义相符。

item.content

object (ItemContent)

要编入索引并支持文本可搜索的商品内容。

item.version

string (bytes format)

必需。索引系统将数据源中的版本存储为字节字符串,并使用词法排序将索引中的项版本与已加入队列的项的版本进行比较。

Cloud Search Indexing 不会将版本值小于或等于当前编入索引项的版本的任何排队项编入索引或删除。此字段的长度上限为 1024 字节。

如需了解内容版本对删除过程有何影响,请参阅在手动删除后处理修订版本

使用 base64 编码的字符串。

item.status

object (ItemStatus)

商品的状态。仅限输出字段。

item.queue

string

此项所属的队列。长度上限为 100 个字符。

item.payload

string (bytes format)

可以为此项存储其他状态连接器。最大长度为 10000 字节。

使用 base64 编码的字符串。

item.itemType

enum (Item.ItemType)

此项目的类型。

connectorName

string

进行此调用的连接器的名称。

格式:datasources/{sourceId}/connectors/{ID}

mode

enum (RequestMode.Mode)

必需。此请求的 RequestMode。

debugOptions

object (DebugOptions)

常用的调试选项。

indexItemOptions

object (IndexItemOptions)

响应正文

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

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/cloud_search.indexing
  • https://www.googleapis.com/auth/cloud_search

有关详情,请参阅授权指南

IndexItemOptions

JSON 表示法
{
  "allowUnknownGsuitePrincipals": boolean
}
字段
allowUnknownGsuitePrincipals

boolean

指定索引请求是否应允许不存在或已被删除的 Google Workspace 主帐号。