The structured JSON data for the document. It should conform to the registeredSchemaor anINVALID_ARGUMENTerror is thrown.
↳ json_data
string
The JSON string representation of the document. It should conform to the registeredSchemaor anINVALID_ARGUMENTerror is thrown.
↳ name
string
Immutable. The full resource name of the document. Format:projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
↳ id
string
Immutable. The identifier of the document. Id should conform toRFC-1034standard with a length limit of 128 characters.
↳ schema_id
string
The identifier of the schema located in the same data store.
The unstructured data linked to this document. Content can only be set and must be set if this document is under aCONTENT_REQUIREDdata store.
↳ parent_document_id
string
The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform toRFC-1034standard with a length limit of 63 characters.
Output only. The last time the document was indexed. If this field is set, the document could be returned in search results. This field is OUTPUT_ONLY. If this field is not populated, it means the document has never been indexed.
Output only. The index status of the document. * * If document is indexed successfully, the index_time field is populated. * * Otherwise, if document is not indexed due to errors, the error_samples field is populated. * * Otherwise, if document's index is in progress, the pending_message field is populated.
getStructData
The structured JSON data for the document. It should conform to the
registeredSchemaor anINVALID_ARGUMENTerror is thrown.
The JSON string representation of the document. It should conform to the
registeredSchemaor anINVALID_ARGUMENTerror is thrown.
Returns
Type
Description
string
hasJsonData
setJsonData
The JSON string representation of the document. It should conform to the
registeredSchemaor anINVALID_ARGUMENTerror is thrown.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getName
Immutable. The full resource name of the document.
Format:projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}.
This field must be a UTF-8 encoded string with a length limit of 1024
characters.
Returns
Type
Description
string
setName
Immutable. The full resource name of the document.
Format:projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}.
This field must be a UTF-8 encoded string with a length limit of 1024
characters.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getId
Immutable. The identifier of the document.
Id should conform toRFC-1034standard with a length limit of 128 characters.
Returns
Type
Description
string
setId
Immutable. The identifier of the document.
Id should conform toRFC-1034standard with a length limit of 128 characters.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getSchemaId
The identifier of the schema located in the same data store.
Returns
Type
Description
string
setSchemaId
The identifier of the schema located in the same data store.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getContent
The unstructured data linked to this document. Content can only be set
and must be set if this document is under aCONTENT_REQUIREDdata store.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Discovery Engine V1 Client - Class Document (1.7.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.7.0 (latest)](/php/docs/reference/cloud-discoveryengine/latest/V1.Document)\n- [1.6.1](/php/docs/reference/cloud-discoveryengine/1.6.1/V1.Document)\n- [1.5.1](/php/docs/reference/cloud-discoveryengine/1.5.1/V1.Document)\n- [1.4.0](/php/docs/reference/cloud-discoveryengine/1.4.0/V1.Document)\n- [1.3.3](/php/docs/reference/cloud-discoveryengine/1.3.3/V1.Document)\n- [1.2.0](/php/docs/reference/cloud-discoveryengine/1.2.0/V1.Document)\n- [1.1.0](/php/docs/reference/cloud-discoveryengine/1.1.0/V1.Document)\n- [1.0.0](/php/docs/reference/cloud-discoveryengine/1.0.0/V1.Document)\n- [0.11.3](/php/docs/reference/cloud-discoveryengine/0.11.3/V1.Document)\n- [0.8.0](/php/docs/reference/cloud-discoveryengine/0.8.0/V1.Document)\n- [0.7.1](/php/docs/reference/cloud-discoveryengine/0.7.1/V1.Document)\n- [0.6.0](/php/docs/reference/cloud-discoveryengine/0.6.0/V1.Document)\n- [0.5.0](/php/docs/reference/cloud-discoveryengine/0.5.0/V1.Document)\n- [0.4.0](/php/docs/reference/cloud-discoveryengine/0.4.0/V1.Document)\n- [0.3.0](/php/docs/reference/cloud-discoveryengine/0.3.0/V1.Document)\n- [0.2.0](/php/docs/reference/cloud-discoveryengine/0.2.0/V1.Document)\n- [0.1.1](/php/docs/reference/cloud-discoveryengine/0.1.1/V1.Document) \nReference documentation and code samples for the Google Cloud Discovery Engine V1 Client class Document.\n\nDocument captures all raw metadata information of items to be recommended or\nsearched.\n\nGenerated from protobuf message `google.cloud.discoveryengine.v1.Document`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ DiscoveryEngine \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getStructData\n\nThe structured JSON data for the document. It should conform to the\nregistered [Schema](/php/docs/reference/cloud-discoveryengine/latest/V1.Schema) or an\n`INVALID_ARGUMENT` error is thrown.\n\n### hasStructData\n\n### setStructData\n\nThe structured JSON data for the document. It should conform to the\nregistered [Schema](/php/docs/reference/cloud-discoveryengine/latest/V1.Schema) or an\n`INVALID_ARGUMENT` error is thrown.\n\n### getJsonData\n\nThe JSON string representation of the document. It should conform to the\nregistered [Schema](/php/docs/reference/cloud-discoveryengine/latest/V1.Schema) or an\n`INVALID_ARGUMENT` error is thrown.\n\n### hasJsonData\n\n### setJsonData\n\nThe JSON string representation of the document. It should conform to the\nregistered [Schema](/php/docs/reference/cloud-discoveryengine/latest/V1.Schema) or an\n`INVALID_ARGUMENT` error is thrown.\n\n### getName\n\nImmutable. The full resource name of the document.\n\nFormat:\n`projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.\nThis field must be a UTF-8 encoded string with a length limit of 1024\ncharacters.\n\n### setName\n\nImmutable. The full resource name of the document.\n\nFormat:\n`projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.\nThis field must be a UTF-8 encoded string with a length limit of 1024\ncharacters.\n\n### getId\n\nImmutable. The identifier of the document.\n\nId should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)\nstandard with a length limit of 128 characters.\n\n### setId\n\nImmutable. The identifier of the document.\n\nId should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)\nstandard with a length limit of 128 characters.\n\n### getSchemaId\n\nThe identifier of the schema located in the same data store.\n\n### setSchemaId\n\nThe identifier of the schema located in the same data store.\n\n### getContent\n\nThe unstructured data linked to this document. Content can only be set\nand must be set if this document is under a `CONTENT_REQUIRED` data store.\n\n### hasContent\n\n### clearContent\n\n### setContent\n\nThe unstructured data linked to this document. Content can only be set\nand must be set if this document is under a `CONTENT_REQUIRED` data store.\n\n### getParentDocumentId\n\nThe identifier of the parent document. Currently supports at most two level\ndocument hierarchy.\n\nId should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)\nstandard with a length limit of 63 characters.\n\n### setParentDocumentId\n\nThe identifier of the parent document. Currently supports at most two level\ndocument hierarchy.\n\nId should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)\nstandard with a length limit of 63 characters.\n\n### getDerivedStructData\n\nOutput only. This field is OUTPUT_ONLY.\n\nIt contains derived data that are not in the original input document.\n\n### hasDerivedStructData\n\n### clearDerivedStructData\n\n### setDerivedStructData\n\nOutput only. This field is OUTPUT_ONLY.\n\nIt contains derived data that are not in the original input document.\n\n### getAclInfo\n\nAccess control information for the document.\n\n### hasAclInfo\n\n### clearAclInfo\n\n### setAclInfo\n\nAccess control information for the document.\n\n### getIndexTime\n\nOutput only. The last time the document was indexed. If this field is set,\nthe document could be returned in search results.\n\nThis field is OUTPUT_ONLY. If this field is not populated, it means the\ndocument has never been indexed.\n\n### hasIndexTime\n\n### clearIndexTime\n\n### setIndexTime\n\nOutput only. The last time the document was indexed. If this field is set,\nthe document could be returned in search results.\n\nThis field is OUTPUT_ONLY. If this field is not populated, it means the\ndocument has never been indexed.\n\n### getIndexStatus\n\nOutput only. The index status of the document.\n\n- If document is indexed successfully, the index_time field is populated.\n- Otherwise, if document is not indexed due to errors, the error_samples field is populated.\n- Otherwise, if document's index is in progress, the pending_message field is populated.\n\n### hasIndexStatus\n\n### clearIndexStatus\n\n### setIndexStatus\n\nOutput only. The index status of the document.\n\n- If document is indexed successfully, the index_time field is populated.\n- Otherwise, if document is not indexed due to errors, the error_samples field is populated.\n- Otherwise, if document's index is in progress, the pending_message field is populated.\n\n### getData"]]