Google Cloud Discovery Engine V1 Client - Class Document (1.0.0)

Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class Document.

Document captures all raw metadata information of items to be recommended or searched.

Generated from protobuf message google.cloud.discoveryengine.v1.Document

Namespace

Google \ Cloud \ DiscoveryEngine \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ struct_data Google\Protobuf\Struct

The structured JSON data for the document. It should conform to the registered Schema or an INVALID_ARGUMENT error is thrown.

↳ json_data string

The JSON string representation of the document. It should conform to the registered Schema or an INVALID_ARGUMENT error 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 to RFC-1034 standard with a length limit of 63 characters.

↳ schema_id string

The identifier of the schema located in the same data store.

↳ content Google\Cloud\DiscoveryEngine\V1\Document\Content

The unstructured data linked to this document. Content must be set if this document is under a CONTENT_REQUIRED data store.

↳ parent_document_id string

The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to RFC-1034 standard with a length limit of 63 characters.

↳ derived_struct_data Google\Protobuf\Struct

Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.

↳ index_time Google\Protobuf\Timestamp

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.

getStructData

The structured JSON data for the document. It should conform to the registered Schema or an INVALID_ARGUMENT error is thrown.

Returns
Type Description
Google\Protobuf\Struct|null

hasStructData

setStructData

The structured JSON data for the document. It should conform to the registered Schema or an INVALID_ARGUMENT error is thrown.

Parameter
Name Description
var Google\Protobuf\Struct
Returns
Type Description
$this

getJsonData

The JSON string representation of the document. It should conform to the registered Schema or an INVALID_ARGUMENT error is thrown.

Returns
Type Description
string

hasJsonData

setJsonData

The JSON string representation of the document. It should conform to the registered Schema or an INVALID_ARGUMENT error 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 to RFC-1034 standard with a length limit of 63 characters.

Returns
Type Description
string

setId

Immutable. The identifier of the document.

Id should conform to RFC-1034 standard with a length limit of 63 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 must be set if this document is under a CONTENT_REQUIRED data store.

Returns
Type Description
Google\Cloud\DiscoveryEngine\V1\Document\Content|null

hasContent

clearContent

setContent

The unstructured data linked to this document. Content must be set if this document is under a CONTENT_REQUIRED data store.

Parameter
Name Description
var Google\Cloud\DiscoveryEngine\V1\Document\Content
Returns
Type Description
$this

getParentDocumentId

The identifier of the parent document. Currently supports at most two level document hierarchy.

Id should conform to RFC-1034 standard with a length limit of 63 characters.

Returns
Type Description
string

setParentDocumentId

The identifier of the parent document. Currently supports at most two level document hierarchy.

Id should conform to RFC-1034 standard with a length limit of 63 characters.

Parameter
Name Description
var string
Returns
Type Description
$this

getDerivedStructData

Output only. This field is OUTPUT_ONLY.

It contains derived data that are not in the original input document.

Returns
Type Description
Google\Protobuf\Struct|null

hasDerivedStructData

clearDerivedStructData

setDerivedStructData

Output only. This field is OUTPUT_ONLY.

It contains derived data that are not in the original input document.

Parameter
Name Description
var Google\Protobuf\Struct
Returns
Type Description
$this

getIndexTime

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.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasIndexTime

clearIndexTime

setIndexTime

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.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getData

Returns
Type Description
string