Method: indexing.datasources.items.index

อัปเดต ACL, ข้อมูลเมตา และเนื้อหา Item รายการ ระบบจะแทรก Item หากยังไม่มี วิธีนี้ไม่รองรับการอัปเดตบางส่วน ระบบจะล้างช่องที่ไม่มีค่าในดัชนี Cloud Search ออก

API นี้ต้องใช้บัญชีผู้ดูแลระบบหรือบัญชีบริการจึงจะสั่งการได้ บัญชีบริการที่ใช้เป็นบัญชีที่อนุญาตพิเศษในแหล่งข้อมูลที่เกี่ยวข้อง

คำขอ HTTP

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

URL ใช้ไวยากรณ์การแปลง 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 จะไม่จัดทำดัชนีหรือลบรายการใดๆ ที่อยู่ในคิวซึ่งมีค่าเวอร์ชันน้อยกว่าหรือเท่ากับเวอร์ชันของรายการที่จัดทำดัชนีในปัจจุบัน ความยาวสูงสุดของช่องนี้คือ 1024 ไบต์

ดูข้อมูลว่าเวอร์ชันรายการส่งผลต่อกระบวนการลบอย่างไรได้ที่จัดการการแก้ไขหลังจากลบด้วยตนเอง

สตริงที่เข้ารหัสแบบ Base64

item.status

object (ItemStatus)

สถานะของรายการ ฟิลด์เอาต์พุตเท่านั้น

item.queue

string

จัดคิวของรายการนี้ มีความยาวได้สูงสุดไม่เกิน 100 อักขระ

item.payload

string (bytes format)

เครื่องมือเชื่อมต่อสถานะเพิ่มเติมจะจัดเก็บรายการนี้ได้ ความยาวสูงสุดคือ 10000 ไบต์

สตริงที่เข้ารหัสแบบ Base64

item.itemType

enum (Item.ItemType)

ประเภทของรายการนี้

connectorName

string

ชื่อของตัวเชื่อมต่อที่เรียกใช้การเรียกนี้

รูปแบบ: แหล่งข้อมูล/{sourceId}/เครื่องมือเชื่อมต่อ/{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 ที่ไม่มีอยู่หรือถูกลบหรือไม่