This page outlines boosting of search results.
Boosting tutorial
This tutorial shows you some examples of product boosting.
For step-by-step guidance on this task directly in Cloud Shell Editor, click Guide me:
The following sections take you through the same steps as clicking Guide me.
Example dataset
This page uses the following dataset as an example. Only the fields necessary for explanation are included.
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.
Java
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.