Skip to main content

documents

Creates, updates, deletes, gets or lists a documents resource.

Overview

Namedocuments
TypeResource
Idgoogle.developerknowledge.documents

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. Contains the resource name of the document. Format: documents/{uri_without_scheme} Example: documents/docs.cloud.google.com/storage/docs/creating-buckets
contentstringOutput only. Contains the full content of the document in Markdown format.
contentLengthBytesinteger (int32)Output only. The length of the content field in bytes.
dataSourcestringOutput only. Specifies the data source of the document. Example data source: firebase.google.com
descriptionstringOutput only. Provides a description of the document.
titlestringOutput only. Provides the title of the document.
updateTimestring (google-datetime)Output only. Represents the timestamp when the content or metadata of the document was last updated.
uristringOutput only. Provides the URI of the content, such as docs.cloud.google.com/storage/docs/creating-buckets.
viewstringOutput only. Specifies the DocumentView of the document. (DOCUMENT_VIEW_UNSPECIFIED, DOCUMENT_VIEW_BASIC, DOCUMENT_VIEW_FULL, DOCUMENT_VIEW_CONTENT)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdocumentsIdviewRetrieves a single document with its full Markdown content.
batch_getselectnames, viewRetrieves multiple documents, each with its full Markdown content.
search_document_chunksexecquery, pageSize, filter, pageTokenSearches for developer knowledge across Google's developer documentation. Returns DocumentChunks based on the user's query. There may be many chunks from the same Document. To retrieve full documents, use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments with the DocumentChunk.parent returned in the SearchDocumentChunksResponse.results.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
documentsIdstring
filterstring
namesstring
pageSizeinteger (int32)
pageTokenstring
querystring
viewstring

SELECT examples

Retrieves a single document with its full Markdown content.

SELECT
name,
content,
contentLengthBytes,
dataSource,
description,
title,
updateTime,
uri,
view
FROM google.developerknowledge.documents
WHERE documentsId = '{{ documentsId }}' -- required
AND view = '{{ view }}'
;

Lifecycle Methods

Searches for developer knowledge across Google's developer documentation. Returns DocumentChunks based on the user's query. There may be many chunks from the same Document. To retrieve full documents, use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments with the DocumentChunk.parent returned in the SearchDocumentChunksResponse.results.

EXEC google.developerknowledge.documents.search_document_chunks
@query='{{ query }}',
@pageSize='{{ pageSize }}',
@filter='{{ filter }}',
@pageToken='{{ pageToken }}'
;