documents
Creates, updates, deletes, gets or lists a documents
resource.
Overview
Name | documents |
Type | Resource |
Id | google.discoveryengine.documents |
Fields
Name | Datatype | Description |
---|---|---|
id | string | Immutable. The identifier of the document. Id should conform to RFC-1034 standard with a length limit of 63 characters. |
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. |
content | object | Unstructured data linked to this document. |
derivedStructData | object | Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document. |
indexStatus | object | Index status of the document. |
indexTime | string | 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. |
jsonData | string | The JSON string representation of the document. It should conform to the registered Schema or an INVALID_ARGUMENT error is thrown. |
parentDocumentId | 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. |
schemaId | string | The identifier of the schema located in the same data store. |
structData | object | The structured JSON data for the document. It should conform to the registered Schema or an INVALID_ARGUMENT error is thrown. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
projects_locations_collections_data_stores_branches_documents_get | SELECT | branchesId, collectionsId, dataStoresId, documentsId, locationsId, projectsId | Gets a Document. |
projects_locations_collections_data_stores_branches_documents_list | SELECT | branchesId, collectionsId, dataStoresId, locationsId, projectsId | Gets a list of Documents. |
projects_locations_data_stores_branches_documents_get | SELECT | branchesId, dataStoresId, documentsId, locationsId, projectsId | Gets a Document. |
projects_locations_data_stores_branches_documents_list | SELECT | branchesId, dataStoresId, locationsId, projectsId | Gets a list of Documents. |
projects_locations_collections_data_stores_branches_documents_create | INSERT | branchesId, collectionsId, dataStoresId, locationsId, projectsId | Creates a Document. |
projects_locations_data_stores_branches_documents_create | INSERT | branchesId, dataStoresId, locationsId, projectsId | Creates a Document. |
projects_locations_collections_data_stores_branches_documents_delete | DELETE | branchesId, collectionsId, dataStoresId, documentsId, locationsId, projectsId | Deletes a Document. |
projects_locations_data_stores_branches_documents_delete | DELETE | branchesId, dataStoresId, documentsId, locationsId, projectsId | Deletes a Document. |
projects_locations_collections_data_stores_branches_documents_patch | UPDATE | branchesId, collectionsId, dataStoresId, documentsId, locationsId, projectsId | Updates a Document. |
projects_locations_data_stores_branches_documents_patch | UPDATE | branchesId, dataStoresId, documentsId, locationsId, projectsId | Updates a Document. |
projects_locations_collections_data_stores_branches_documents_import | EXEC | branchesId, collectionsId, dataStoresId, locationsId, projectsId | Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items are created. Note: It is possible for a subset of the Documents to be successfully updated. |
projects_locations_collections_data_stores_branches_documents_purge | EXEC | branchesId, collectionsId, dataStoresId, locationsId, projectsId | Permanently deletes all selected Documents in a branch. This process is asynchronous. Depending on the number of Documents to be deleted, this operation can take hours to complete. Before the delete operation completes, some Documents might still be returned by DocumentService.GetDocument or DocumentService.ListDocuments. To get a list of the Documents to be deleted, set PurgeDocumentsRequest.force to false. |
projects_locations_data_stores_branches_documents_import | EXEC | branchesId, dataStoresId, locationsId, projectsId | Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items are created. Note: It is possible for a subset of the Documents to be successfully updated. |
projects_locations_data_stores_branches_documents_purge | EXEC | branchesId, dataStoresId, locationsId, projectsId | Permanently deletes all selected Documents in a branch. This process is asynchronous. Depending on the number of Documents to be deleted, this operation can take hours to complete. Before the delete operation completes, some Documents might still be returned by DocumentService.GetDocument or DocumentService.ListDocuments. To get a list of the Documents to be deleted, set PurgeDocumentsRequest.force to false. |
SELECT
examples
Gets a list of Documents.
SELECT
id,
name,
content,
derivedStructData,
indexStatus,
indexTime,
jsonData,
parentDocumentId,
schemaId,
structData
FROM google.discoveryengine.documents
WHERE branchesId = '{{ branchesId }}'
AND dataStoresId = '{{ dataStoresId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new documents
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.discoveryengine.documents (
branchesId,
dataStoresId,
locationsId,
projectsId,
structData,
jsonData,
name,
schemaId,
content,
parentDocumentId
)
SELECT
'{{ branchesId }}',
'{{ dataStoresId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ structData }}',
'{{ jsonData }}',
'{{ name }}',
'{{ schemaId }}',
'{{ content }}',
'{{ parentDocumentId }}'
;
- name: your_resource_model_name
props:
- name: structData
value: object
- name: jsonData
value: string
- name: name
value: string
- name: id
value: string
- name: schemaId
value: string
- name: content
value:
- name: rawBytes
value: string
- name: uri
value: string
- name: mimeType
value: string
- name: parentDocumentId
value: string
- name: derivedStructData
value: object
- name: indexTime
value: string
- name: indexStatus
value:
- name: indexTime
value: string
- name: errorSamples
value:
- - name: code
value: integer
- name: message
value: string
- name: details
value:
- object
UPDATE
example
Updates a documents
resource.
/*+ update */
UPDATE google.discoveryengine.documents
SET
structData = '{{ structData }}',
jsonData = '{{ jsonData }}',
name = '{{ name }}',
schemaId = '{{ schemaId }}',
content = '{{ content }}',
parentDocumentId = '{{ parentDocumentId }}'
WHERE
branchesId = '{{ branchesId }}'
AND dataStoresId = '{{ dataStoresId }}'
AND documentsId = '{{ documentsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
DELETE
example
Deletes the specified documents
resource.
/*+ delete */
DELETE FROM google.discoveryengine.documents
WHERE branchesId = '{{ branchesId }}'
AND dataStoresId = '{{ dataStoresId }}'
AND documentsId = '{{ documentsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';