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

必需。要移除搜索历史记录建议的父级引擎资源名称的 completionConfig,例如 projects/*/locations/global/collections/default_collection/engines/*/completionConfig

请求正文

请求正文中包含结构如下的数据:

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

  // Union field suggestion can be only one of the following:
  "searchHistorySuggestion": string,
  "removeAllSearchHistorySuggestions": boolean
  // End of list of possible types for union field suggestion.
}
字段
userPseudoId

string

必需。用于跟踪访问者的唯一标识符。例如,可以使用 HTTP Cookie 实现此目的,该 Cookie 应能够唯一标识单个设备上的访问者。如果访问者登录或退出网站,此唯一标识符不应发生变化。

此字段不应具有固定值,例如 unknown_visitor

此标识符应与 UserEvent.user_pseudo_idSearchRequest.user_pseudo_id 相同。

该字段必须是 UTF-8 编码的字符串,长度限制为 128 个字符。

userInfo

object (UserInfo)

可选。有关最终用户的信息。

此信息应与 UserEvent.user_infoSearchRequest.user_info 中的标识符信息相同。

removeTime

string (Timestamp format)

必需。建议的移除时间。如果未设置,则使用当前时间。

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

联合字段 suggestion。要移除的建议。suggestion 只能是下列其中一项:
searchHistorySuggestion

string

要移除的搜索记录建议。

removeAllSearchHistorySuggestions

boolean

移除用户的所有搜索记录建议。

响应正文

如果成功,则响应正文为空。

授权范围

需要以下 OAuth 范围之一:

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

如需了解详情,请参阅 Authentication Overview