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)

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

Cloud Search 索引不会将版本值小于或等于当前已编入索引的项的版本的任何已加入队列的项编入索引或删除。此字段的最大长度为 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

如需了解详情,请参阅 OAuth 2.0 概览

IndexItemOptions 类的构造函数

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

boolean

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