Method: query.debugSearch
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Cloud Search クエリ API が検索方法を提供している場合、デバッグ情報を返します。
注: この API を実行するには、標準のエンドユーザー アカウントが必要です。サービス アカウントはクエリ API リクエストを直接実行できません。サービス アカウントを使用してクエリを実行するには、Google Workspace ドメイン全体の権限の委任を設定します。
HTTP リクエスト
POST https://cloudsearch.googleapis.com/v1/query:debugSearch
この URL は gRPC Transcoding 構文を使用します。
リクエストの本文
リクエストの本文には、次の構造のデータが含まれます。
フィールド |
requestOptions |
object (RequestOptions )
検索アプリやユーザーのタイムゾーンなどのリクエスト オプション。
|
query |
string
未加工のクエリ文字列。サポートされている検索演算子については、演算子を使用して検索を絞り込むをご覧ください。
|
pageSize |
integer
1 ページで返される検索結果の最大数。有効な値は 1 ~ 100 です。デフォルト値は 10 です。2,000 件を超える結果がリクエストされた場合の最小値は 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 Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[],[],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)."]]