Method: indexing.datasources.items.index

Updates Item ACL, metadata, and content. It will insert the Item if it does not exist. This method does not support partial updates. Fields with no provided values are cleared out in the Cloud Search index.

This API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source.

HTTP request

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

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
item.name

string

The name of the Item. Format: datasources/{sourceId}/items/{itemId}

This is a required field. The maximum length is 1536 characters.

Request body

The request body contains data with the following structure:

JSON representation
{
  "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)
  }
}
Fields
item.acl

object (ItemAcl)

Access control list for this item.

item.metadata

object (ItemMetadata)

The metadata information.

item.structuredData

object (ItemStructuredData)

The structured data for the item that should conform to a registered object definition in the schema for the data source.

item.content

object (ItemContent)

Item content to be indexed and made text searchable.

item.version

string (bytes format)

Required. The indexing system stores the version from the datasource as a byte string and compares the Item version in the index to the version of the queued Item using lexical ordering.

Cloud Search Indexing won't index or delete any queued item with a version value that is less than or equal to the version of the currently indexed item. The maximum length for this field is 1024 bytes.

For information on how item version affects the deletion process, refer to Handle revisions after manual deletes.

A base64-encoded string.

item.status

object (ItemStatus)

Status of the item. Output only field.

item.queue

string

Queue this item belongs to. The maximum length is 100 characters.

item.payload

string (bytes format)

Additional state connector can store for this item. The maximum length is 10000 bytes.

A base64-encoded string.

item.itemType

enum (Item.ItemType)

The type for this item.

connectorName

string

The name of connector making this call.

Format: datasources/{sourceId}/connectors/{ID}

mode

enum (RequestMode.Mode)

Required. The RequestMode for this request.

debugOptions

object (DebugOptions)

Common debug options.

indexItemOptions

object (IndexItemOptions)

Response body

If successful, the response body contains an instance of Operation.

Authorization Scopes

Requires one of the following OAuth scopes:

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

For more information, see the Authorization guide.

IndexItemOptions

JSON representation
{
  "allowUnknownGsuitePrincipals": boolean
}
Fields
allowUnknownGsuitePrincipals

boolean

Specifies if the index request should allow Google Workspace principals that do not exist or are deleted.