本页简要介绍了如何提升搜索结果。
教程:升位
本教程将向您展示一些商品升位示例。
如需遵循有关此任务的分步指导,请直接在 Cloud Shell Editor 中点击操作演示:
操作演示
示例数据集
本页以下面的数据集为例。仅包含说明所需的字段。
商品数据集示例
id |
title |
brands |
categories |
price_info.price |
"nest_mini_2nd_gen" |
"Nest Mini (2nd gen)" |
["Google", "Nest"] |
["Nest > speakers and displays"] |
49.00 |
"nest_audio" |
"Nest Audio" |
["Google", "Nest"] |
["Nest > speakers and displays"] |
99.99 |
"nest_hub_max" |
"Nest Hub Max" |
["Google", "Nest"] |
["Nest > speakers and displays"] |
229.00 |
"nest_hub" |
"Nest Hub" |
["Google", "Nest"] |
["Nest > speakers and displays"] |
88.99 |
"google_home_max" |
"Google Home Max" |
["Google", "Nest"] |
["Nest > speakers and displays"] |
299.00 |
"google_home_mini" |
"Google Home Mini" |
["Google", "Nest"] |
["Nest > speakers and displays"] |
49.00 |
"google_pixel_5" |
"Google Pixel 5" |
["Google", "Pixel"] |
["Pixel > phones"] |
699.00 |
"google_pixel_4a_with_5g" |
"Google Pixel 4a with 5G" |
["Google", "Pixel"] |
["Pixel > phones"] |
499.00 |
"google_pixel_4a" |
"Google Pixel 4a Phones" |
["Google", "Pixel"] |
["Pixel > phones"] |
349.00 |
"google_pixel_stand" |
"Google Pixel Stand" |
["Google", "Pixel"] |
["Pixel > featured accessories"] |
79.00 |
"google_pixel_buds" |
"Google Pixel Buds" |
["Google", "Pixel"] |
["Pixel > featured accessories"] |
179.00 |
"google_pixel_5_case" |
"Google Pixel 5 Case" |
["Google", "Pixel"] |
["Pixel > featured accessories"] |
40.00 |
"google_pixel_4a_5g_case" |
"Google Pixel 4a (5G) Case" |
["Google", "Pixel"] |
["Pixel > featured accessories"] |
40.00 |
"google_pixel_4a_case" |
"Google Pixel 4a Case" |
["Google", "Pixel"] |
["Pixel > featured accessories"] |
40.00 |
前提条件
如需了解过滤器表达式语法,请参阅对结果进行过滤和排序。
提升
借助升位功能,您可以通过将升位功能应用于
对结果进行优先级排序还是降低其优先级。
例如,如果您搜索“Google speaker”,那么您会收到无序的“nest_mini_2nd_gen”、“nest_audio”、“nest_hub_max”、“nest_hub”、“google_home_max”和“google_home_mini”。
假设您希望优先展示更便宜的产品(低于 95
,并将较贵的商品(高于 95 美元)降低优先级。您可以
应用以下升位规范:
JSON
{
condition_boost_specs {
condition: "price: IN(*, 95.0e)"
boost: 0.5
}
condition_boost_specs {
condition: "price: IN(95.0e, *)"
boost: -0.5
}
}
结果中,“nest_mini_2nd_gen”“google_home_mini”和“nest_hub”可能是
前三个,而“nest_audio”“nest_hub_max”和“google_home_max”可能是
最后三个。但这并不保证一定顺序
按价格排序,如过滤结果并对其进行排序中所述。