Method: query.debugSearch

傳回 Cloud Search 查詢 API 的偵錯資訊,該 API 提供搜尋方法。

注意:執行這個 API 需要標準使用者帳戶。服務帳戶無法直接執行查詢 API 要求。如要使用服務帳戶執行查詢,請設定 Google Workspace 全網域委派權限

HTTP 要求

POST https://cloudsearch.googleapis.com/v1/query:debugSearch

這個網址使用 gRPC 轉碼語法。

要求主體

要求主體的資料會採用以下結構:

JSON 表示法
{
  "requestOptions": {
    object (RequestOptions)
  },
  "query": string,
  "pageSize": integer,
  "start": integer,
  "dataSourceRestrictions": [
    {
      object (DataSourceRestriction)
    }
  ],
  "facetOptions": [
    {
      object (FacetOptions)
    }
  ],
  "sortOptions": {
    object (SortOptions)
  },
  "queryInterpretationOptions": {
    object (QueryInterpretationOptions)
  },
  "contextAttributes": [
    {
      object (ContextAttribute)
    }
  ]
}
欄位
requestOptions

object (RequestOptions)

請求選項,例如搜尋應用程式和使用者時區。

query

string

原始查詢字串。如要瞭解支援的搜尋運算子,請參閱「使用運算子縮小搜尋範圍」一文

pageSize

integer

每頁傳回的搜尋結果數量上限。有效值介於 1 到 100 之間 (含 1 和 100)。預設值為 10。如要要求超過 2000 筆結果,最小值為 50。

start

integer

結果的起始索引。

dataSourceRestrictions[]

object (DataSourceRestriction)

用於查詢的來源。如未指定,系統會使用目前搜尋應用程式的所有資料來源。

facetOptions[]

object (FacetOptions)

sortOptions

object (SortOptions)

排序搜尋結果的選項

queryInterpretationOptions

object (QueryInterpretationOptions)

選項來解讀使用者查詢。

contextAttributes[]

object (ContextAttribute)

要求的內容屬性,用於調整搜尋結果的排名。元素數量上限為 10。

回應主體

偵錯查詢.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

詳情請參閱授權指南