Search and browse

This document aims to clarify the distinctions between search and browse functionalities within Vertex AI Search for commerce in order to explore how to configure each effectively and get more out of them.

Understand the core differences

While search and browse help customers find products, they cater to different user journeys and require distinct configurations.

Driven by user intent, where a shopper enters a specific query, such as red running shoes. Vertex AI Search for commerce analyzes this query to understand the user's needs and returns relevant products optimized for revenue.

In short, for search, Vertex AI Search for commerce is responsible for the relevance of products and its ranking (revenue optimized).

Browse

Guided by predefined categories, where a shopper navigates through product listings organized by attributes like brand, category, or promotions, such as Shirts in the Men's Clothing category. You define these categories, displaying products in them.

You're responsible for the relevance of products listed (through filters), and Vertex AI Search for commerce is responsible for its ranking (revenue-optimized).

Configure search and browse

The beauty of Vertex AI Search for commerce lies in its unified API for both search and browse requests.

Configure search

User events for search should have these fields, along with other standard mandatory fields for user events (eventType = "search"):

  • Text query: The core of a search request. It captures the user's search intent.
  • Filters (Optional): Allow users to refine search results by applying facets like brand, price range, or color.
  • Ranking and Personalization: Vertex AI Search for commerce automatically optimizes the ranking of search results based on relevance and potential revenue. Personalization further tailors results based on individual user behavior.

    # Construct the search request
    search_request = {
      "query": "red running shoes", # User's search query
      "filter": "brand:ANY('Nike')", # Optional filter
      "page_size": 10 # Number of results per page
    }
    
    # Send the request to the VAIS:Commerce API
    search_response = client.search(search_request)
    
    # Process the search results
    for product in search_response.results:
      print(product.title, product.price)

For basic querying with search, including text query searches, browse searches, pagination, optimization, and personalized results, refer to Get search results.

Configure browse

User events for browse should have the these fields, along with other standard mandatory fields for user events (eventType = "search" for browse events as well):

  • Page category: Represents the category or banner under which products appear.
  • Compulsory filter: Defines the criteria for products to be included in the browse results. This ensures only relevant products appear in the category.
  • Additional filter using facet selection (Optional): Enable users to further filter products within the category.

    # Construct the browse request
    browse_request = {
      "page_category": "Men's > Clothing > Shirts", # Browse category
      "filter": "category:ANY('Shirts') AND gender: ANY('Male')", # Compulsory filter
      "page_size": 10 # Number of results per page
    }
    
    # Send the request to the VAIS:Commerce API
    browse_response = client.search(browse_request)
    
    # Process the browse results
    for product in browse_response.results:
      print(product.title, product.price)

Refer to Get recommendations for how to request product recommendations for a specific user and user event.