您可以指定应在搜索中提升的记录。
教程:升位
本教程将向您展示一些商品升位示例。
如需遵循有关此任务的分步指导,请直接在 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”可能是后三个。但无法保证特定顺序,这与按价格排序不同,如过滤和排序结果中所述。