Empowering Retailers with Google quality Search & Recommendations — Part 2

Yash Badani
Google Cloud - Community
6 min readDec 14, 2022

In the previous blog, we discussed about the basics of Retail Search and how to import Catalog data in Retail Search Catalog. Ever wondered, how can I provide the correct faceting options to the users based on the search query they provided. Or basically curate the search for your own website that can take some actions ?

Photo by Heidi Fin on Unsplash

Like for example, a user queries for “shampoo”—

  • You provide a facet for “Hair Type” to filter on. Ofcourse, it does not make sense to provide them “Size” facet in this case, as the facet is not applicable!
  • Moreover, I may have a curated webpage for certain shampoos/brands/etc and want users to be redirected to that web page.
  • Or let’s say I want to show products from brand ABC on the top of the page and products with price > $12 on the bottom of the page

Sounds familiar right ?

Dynamic Faceting

Retail search provides the feature called Dynamic Faceting. But what are “facets” ? You must have visited your favorite ecommerce website and tried to apply some filters like filtering on brand, price or size. Yes, the filter options are called dynamic facets and it tells you what filters are applicable for the query term. So if you are searching for a pair of “Denims” — it “dynamically” provides the applicable facets like color, size, wash, brand, price, etc. If you search for “sunglasses” — it provides you facets that are applicable like size, color, brand, powered, type, etc.

Dynamic Faceting improves over time with user events streaming into Retail Search. It does provide good results without the user events as well. But it is recommended that you feed the user events to the system before deploying for production use to ensure acceptable results.

But how do I enable dynamic faceting ? We’ll see below

Serving Configurations

Every query to the Search API happens via the Serving Configuration. It helps you configure the search and serves as the entry point to serve results. Hence, this is the place where you can curate the search for your website!

In the previous part of the blog, we selected “default_search” serving configuration to Evaluate and try the Retail Search for the data imported. This serving configuration is created by default by Retail Search.

To create a new serving configuration for Search -

  • Click on Serving Configs from the menu to list the existing serving configurations. You’ll see the default_search serving configuration in the list.
  • Select “Create Serving Config” option on the top.
  • There’s option to create Serving Configuration for Recommendation or Search. We’ll focus on Search
  • Next, there is an option to enable dynamic faceting! This will allow the search queries on this serving configuration to return with dynamic facets.
  • Here, we have an option to Create Controls or add existing controls. But what are Controls ?
Photo by Drew Patrick Miller on Unsplash

Serving Controls

Serving Controls are part of the Serving Configurations to “control” the search results. A search query & results get applied to all the serving controls linked to the serving config. Retail Search provides multiple serving control options as follows:

Types of Serving Controls

To create a new serving control, you can either select the “Create New Control” option during Serving Config creation or Go to controls and select “Serving Control” tab

  • Click on “+ Create Control” button on top. A modal will appear on right to fill details. In the “Preferences”, provide the control name, select “Search” and select a control type.
  • We’ll create a Boost/bury control to show products from brand “Johnson & Johnson” on top(boost) when user searches for “shampoo”. Click on Continue to configure this.
  • For “Triggers”, we need to configure what will trigger this control. If you specify certain query terms — then it will trigger for those terms only, else it will trigger for each search request. We want to only trigger for “shampoo” or “hair wash”. Press enter after providing each term.

Bonus: The Search API provides 2 ways to retrieve products — Search or Browse. A Browse request happens when there is no “query” parameter in the Search API call and “pageCategories” field is specified along with other filters. This means that the user is browsing categories. The only way to test Browse events is through the search API. The evaluate page only supports Search query.

  • Click on Continue and Select the action for Boost/bury. We decided to boost “Johnson & Johnson” products on top. Select the values as below. Note that the Boost/bury slider ranges from -1 to 1. A high value means boost and a low value means bury.
  • Click Continue and select the serving config to which you want to apply. Select the serving config you created above or apply it to default search.

Now, lets compare the results. Initially if we searched for “shampoo”: We got the results as follows

After attaching the serving control to our serving configuration, it should look like below:

After going to the evaluate page again and searching for “Shampoo”, we’re now getting the products from “Johnson & Johnson” on top. Notice that the other products drifted towards the bottom making way for boosted products on top.

Note: Setting to 1.0 gives the item a big promotion. However, it does not necessarily mean that the boosted item will be the top result at all times, nor that other items will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant items.[ref]

You can also try creating other controls and use them as needed. There’s also an option to export all the controls and import them as needed to your other Google Cloud projects and environments.

Additionally, you can also use the APIs provided by Retail Search to create Serving controls and configurations. It helps you automate managing the controls.

I hope it was pretty exciting to learn around basics of Retail Search. Please checkout the official documentation to know more about the product.

We just scratched the surface, but Until next time!

References

--

--