Google Cloud Discovery Engine V1 Client - Class Document (0.6.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
NameDescription
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.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.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.

getStructData

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

Returns
TypeDescription
Google\Protobuf\Struct|null

hasStructData

setStructData

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

Parameter
NameDescription
var Google\Protobuf\Struct
Returns
TypeDescription
$this

getJsonData

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

Returns
TypeDescription
string

hasJsonData

setJsonData

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

Parameter
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$this

getId

Immutable. The identifier of the document.

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

Returns
TypeDescription
string

setId

Immutable. The identifier of the document.

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getSchemaId

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

Returns
TypeDescription
string

setSchemaId

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getContent

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

Returns
TypeDescription
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
NameDescription
var Google\Cloud\DiscoveryEngine\V1\Document\Content
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$this

getDerivedStructData

Output only. This field is OUTPUT_ONLY.

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

Returns
TypeDescription
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
NameDescription
var Google\Protobuf\Struct
Returns
TypeDescription
$this

getData

Returns
TypeDescription
string