REST Resource: projects.locations.dataStores.branches.documents

資源:Document

文件會擷取要推薦或搜尋的項目所有原始中繼資料資訊。

JSON 表示法
{
  "name": string,
  "id": string,
  "schemaId": string,
  "content": {
    object (Content)
  },
  "parentDocumentId": string,
  "derivedStructData": {
    object
  },
  "aclInfo": {
    object (AclInfo)
  },
  "indexTime": string,
  "indexStatus": {
    object (IndexStatus)
  },

  // Union field data can be only one of the following:
  "structData": {
    object
  },
  "jsonData": string
  // End of list of possible types for union field data.
}
欄位
name

string

不可變動。文件的完整資源名稱。格式:projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/branches/{branch}/documents/{documentId}

這個欄位必須是 UTF-8 編碼的字串,長度上限為 1024 個字元。

id

string

不可變動。文件的 ID。

ID 應符合 RFC-1034 標準,長度上限為 128 個字元。

schemaId

string

位於相同資料存放區的結構定義 ID。

content

object (Content)

與這份文件連結的非結構化資料。如果這份文件位於 CONTENT_REQUIRED 資料儲存庫中,就只能設定內容,且必須設定內容。

parentDocumentId

string

父項文件的 ID。目前最多支援兩層文件階層。

ID 應符合 RFC-1034 標準,長度上限為 63 個字元。

derivedStructData

object (Struct format)

僅供輸出。這個欄位為 OUTPUT_ONLY。當中包含原始輸入文件中沒有的衍生資料。

aclInfo

object (AclInfo)

文件的存取權控管資訊。

indexTime

string (Timestamp format)

僅供輸出。文件上次編入索引的時間。如果設定這個欄位,文件可能會顯示在搜尋結果中。

這個欄位為 OUTPUT_ONLY。如果這個欄位未填入任何內容,表示文件從未編入索引。

使用 RFC 3339,產生的輸出內容一律會經過 Z 標準化,並使用 0、3、6 或 9 個小數點後位數。系統也接受「Z」以外的偏移量。例如:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

indexStatus

object (IndexStatus)

僅供輸出。文件的索引狀態。

  • 如果文件成功編入索引,系統會填入 indexTime 欄位。
  • 否則,如果文件因錯誤而未編入索引,系統會填入 errorSamples 欄位。
  • 否則,如果文件索引作業正在進行中,系統會填入 pendingMessage 欄位。
聯集欄位 data。資料顯示。請提供 struct_datajson_data 其中一個,否則系統會擲回 INVALID_ARGUMENT 錯誤。data 只能是下列其中一項:
structData

object (Struct format)

文件的結構化 JSON 資料。這項屬性應符合已註冊的 Schema,否則會擲回 INVALID_ARGUMENT 錯誤。

jsonData

string

文件的 JSON 字串表示法。這項屬性應符合已註冊的 Schema,否則會擲回 INVALID_ARGUMENT 錯誤。

方法

create

建立 Document

delete

刪除 Document

get

取得 Document

getProcessedDocument

取得 Document 的剖析版面配置資訊。

import

大量匯入多個 Document

list

取得 Document 清單。

patch

更新 Document

purge

永久刪除分支版本中的所有選取 Document