Method: query.debugSearch
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
返回 Cloud Search 查询的调试信息。API 提供搜索方法。
注意:此 API 需要使用标准最终用户账号才能执行。服务账号无法直接执行查询 API 请求;如需使用服务账号执行查询,请设置 Google Workspace 全网域授权。
HTTP 请求
POST https://cloudsearch.googleapis.com/v1/query:debugSearch
网址采用 gRPC 转码语法。
请求正文
请求正文中包含结构如下的数据:
字段 |
requestOptions |
object (RequestOptions )
请求选项,例如搜索应用和用户时区。
|
query |
string
原始查询字符串。如需查看支持的搜索运算符,请参阅使用运算符缩小搜索范围
|
pageSize |
integer
一页返回的搜索结果数上限。有效值介于 1 到 100 之间(包括这两个数值)。默认值为 10。如果请求的结果数量超过 2000 个,则最小值为 50。
|
start |
integer
结果的起始索引。
|
dataSourceRestrictions[] |
object (DataSourceRestriction )
用于查询的来源。如果未指定,则使用当前搜索应用中的所有数据源。
|
facetOptions[] |
object (FacetOptions )
|
sortOptions |
object (SortOptions )
用于对搜索结果排序的选项
|
queryInterpretationOptions |
object (QueryInterpretationOptions )
用于解释用户查询的选项。
|
contextAttributes[] |
object (ContextAttribute )
请求的上下文属性,将用于调整搜索结果的排名。元素数量上限为 10。
|
响应正文
调试 query.search 响应。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"searchResponse": {
object (SearchResponse )
},
"gsrRequest": string,
"gsrResponse": string
} |
字段 |
searchResponse |
object (SearchResponse )
Query.search 响应。
|
gsrRequest |
string (bytes format)
GenericSearchRequest 的序列化字符串。 使用 base64 编码的字符串。
|
gsrResponse |
string (bytes format)
GenericSearchResponse 的序列化字符串。 使用 base64 编码的字符串。
|
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/cloud_search.query
https://www.googleapis.com/auth/cloud_search
如需了解详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# Method: query.debugSearch\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.DebugResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nReturns Debug information for Cloud Search query API provides the search method.\n\n**Note:** This API requires a standard end user account to execute. A service account can't perform query API requests directly; to use a service account to perform queries, set up [Google Workspace domain-wide delegation of authority](https://developers.google.com/workspace/cloud-search/docs/guides/delegation/).\n\n### HTTP request\n\n`POST https://cloudsearch.googleapis.com/v1/query:debugSearch`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"requestOptions\": { object (/workspace/cloud-search/docs/reference/rest/v1/RequestOptions) }, \"query\": string, \"pageSize\": integer, \"start\": integer, \"dataSourceRestrictions\": [ { object (/workspace/cloud-search/docs/reference/rest/v1/settings.searchapplications#DataSourceRestriction) } ], \"facetOptions\": [ { object (/workspace/cloud-search/docs/reference/rest/v1/settings.searchapplications#FacetOptions) } ], \"sortOptions\": { object (/workspace/cloud-search/docs/reference/rest/v1/settings.searchapplications#SortOptions) }, \"queryInterpretationOptions\": { object (/workspace/cloud-search/docs/reference/rest/v1/QueryInterpretationOptions) }, \"contextAttributes\": [ { object (/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#ContextAttribute) } ] } ``` |\n\n| Fields ||\n|------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requestOptions` | `object (`[RequestOptions](/workspace/cloud-search/docs/reference/rest/v1/RequestOptions)`)` Request options, such as the search application and user timezone. |\n| `query` | `string` The raw query string. See supported search operators in the [Narrow your search with operators](https://support.google.com/cloudsearch/answer/6172299) |\n| `pageSize` | `integer` Maximum number of search results to return in one page. Valid values are between 1 and 100, inclusive. Default value is 10. Minimum value is 50 when results beyond 2000 are requested. |\n| `start` | `integer` Starting index of the results. |\n| `dataSourceRestrictions[]` | `object (`[DataSourceRestriction](/workspace/cloud-search/docs/reference/rest/v1/settings.searchapplications#DataSourceRestriction)`)` The sources to use for querying. If not specified, all data sources from the current search application are used. |\n| `facetOptions[]` | `object (`[FacetOptions](/workspace/cloud-search/docs/reference/rest/v1/settings.searchapplications#FacetOptions)`)` |\n| `sortOptions` | `object (`[SortOptions](/workspace/cloud-search/docs/reference/rest/v1/settings.searchapplications#SortOptions)`)` The options for sorting the search results |\n| `queryInterpretationOptions` | `object (`[QueryInterpretationOptions](/workspace/cloud-search/docs/reference/rest/v1/QueryInterpretationOptions)`)` options to interpret the user query. |\n| `contextAttributes[]` | `object (`[ContextAttribute](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#ContextAttribute)`)` Context attributes for the request which will be used to adjust ranking of search results. The maximum number of elements is 10. |\n\n### Response body\n\nDebug query.search Response.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"searchResponse\": { object (/workspace/cloud-search/docs/reference/rest/v1/SearchResponse) }, \"gsrRequest\": string, \"gsrResponse\": string } ``` |\n\n| Fields ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `searchResponse` | `object (`[SearchResponse](/workspace/cloud-search/docs/reference/rest/v1/SearchResponse)`)` Query.search response. |\n| `gsrRequest` | `string (`[bytes](https://developers.google.com/discovery/v1/type-format)` format)` Serialized string of GenericSearchRequest. A base64-encoded string. |\n| `gsrResponse` | `string (`[bytes](https://developers.google.com/discovery/v1/type-format)` format)` Serialized string of GenericSearchResponse. A base64-encoded string. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud_search.query`\n- `https://www.googleapis.com/auth/cloud_search`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]