Method: projects.locations.collections.engines.completionConfig.removeSuggestion

為使用者移除引擎中的搜尋記錄建議。這麼做會從該使用者的 AdvancedCompleteQueryResponse.recent_search_suggestions 中移除建議。如果使用者再次搜尋相同的建議,系統會覆寫新記錄,並再次建議該項目。

HTTP 要求


POST https://discoveryengine.googleapis.com/v1beta/{completionConfig=projects/*/locations/*/collections/*/engines/*/completionConfig}:removeSuggestion

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

路徑參數

參數
completionConfig

string

這是必要旗標,要移除 Google 搜尋記錄建議的父項引擎資源名稱,例如 projects/*/locations/global/collections/default_collection/engines/*/completionConfig。

要求主體

要求主體包含下列結構的資料:

JSON 表示法
{
  "userPseudoId": string,
  "userInfo": {
    object (UserInfo)
  },
  "removeTime": string,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "searchHistorySuggestion": string,
  "removeAllSearchHistorySuggestions": boolean
  // End of mutually exclusive fields.
}
欄位
userPseudoId

string

這是必要旗標,用於追蹤訪客的專屬 ID。舉例來說,這項功能可以透過 HTTP Cookie 實作,應能識別單一裝置上的訪客。訪客登入或登出網站時,這個專屬 ID 不應變更。

這個欄位「不應」有固定值,例如 unknown_visitor。

這個 ID 應與 UserEvent.user_pseudo_id 和 SearchRequest.user_pseudo_id 相同。

這個欄位必須是 UTF-8 編碼的字串,長度上限為 128 個半形字元。

userInfo

object (UserInfo)

選用。使用者資訊。

這應與 UserEvent.user_info 和 SearchRequest.user_info 的 ID 資訊相同。

removeTime

string (Timestamp format)

這是必要旗標,建議移除時間。如未設定,系統會使用目前時間。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z"、"2014-10-02T15:01:23.045123456Z" 或 "2014-10-02T15:01:23+05:30"。

要移除的建議。以下列出互斥欄位。回應中最多會設定一個欄位:
searchHistorySuggestion

string

要移除的 Google 搜尋記錄建議。

removeAllSearchHistorySuggestions

boolean

移除使用者的所有 Google 搜尋記錄建議。

互斥欄位的結尾。

回應主體

如果成功,回應主體會是空白。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.assist.readwrite
  • https://www.googleapis.com/auth/discoveryengine.readwrite
  • https://www.googleapis.com/auth/discoveryengine.serving.readwrite

詳情請參閱Authentication Overview。

IAM 權限

需要 completionConfig 資源的下列 IAM 權限:

  • discoveryengine.completionConfigs.removeSuggestion

詳情請參閱 IAM 說明文件。