This page outlines boosting of search results.
Boosting tutorial
This tutorial shows you some examples of product boosting.
To follow step-by-step guidance for this task directly in the
Cloud Shell Editor, click Guide me:
Guide me
Example dataset
This page uses the following dataset as an example. Only the fields necessary
for explanation are included.
Example product dataset
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 |
Prerequisites
See Filter and order results for the filter expression syntax.
Boost
With boosting, you can control the result ranking by apply a boost to
prioritize or deprioritize the results.
For example, if you search for "Google speaker", then you would get
"nest_mini_2nd_gen", "nest_audio", "nest_hub_max", "nest_hub", "google_home_max"
and "google_home_mini" in no specific order.
Suppose that you want to prioritize the cheaper products (less than 95
dollars) and deprioritize the expensive ones (higher than 95 dollars). You can
apply a boost spec as:
JSON
{
condition_boost_specs {
condition: "price: IN(*, 95.0e)"
boost: 0.5
}
condition_boost_specs {
condition: "price: IN(95.0e, *)"
boost: -0.5
}
}
In the result, "nest_mini_2nd_gen", "google_home_mini" and "nest_hub" might be the
first three, while "nest_audio", "nest_hub_max" and "google_home_max" might be
last three. However, no specific order is guaranteed, which is different from
ordering by price, as discussed in Filter and order results.