搜尋和瀏覽

本文旨在釐清 Vertex AI Search for commerce 的搜尋和瀏覽功能差異,並探討如何有效設定各項功能,進一步發揮其效益。

瞭解核心差異

搜尋和瀏覽功能都能協助顧客尋找產品,但兩者適用於不同的使用者歷程,因此需要不同的設定。

由使用者意圖驅動,購物者會輸入特定查詢,例如「紅色慢跑鞋」。Vertex AI Search for Commerce 會分析這項查詢,瞭解使用者的需求,並傳回經過收益最佳化的相關產品。

簡而言之,就搜尋功能而言,Vertex AI Search 電子商務套件負責產品關聯性和排名 (收益最佳化)。

瀏覽

購物者可依據預先定義的類別,瀏覽依品牌、類別或促銷活動等屬性整理的產品資訊,例如「男裝」類別中的「襯衫」。這些類別由你定義,並在其中顯示產品。

你負責列出相關產品 (透過篩選器),商家適用的 Vertex AI Search 則負責產品排名 (以收益為優先)。

設定搜尋和瀏覽功能

Vertex AI Search for Commerce 的優點在於,搜尋和瀏覽要求都使用統一的 API。

設定搜尋功能

搜尋的使用者事件應包含下列欄位,以及使用者事件的其他標準必填欄位 (eventType = "search"):

  • 查詢文字:搜尋要求的核心。可擷取使用者的搜尋意圖。
  • 篩選器 (選用):允許使用者套用品牌、價格範圍或顏色等商情項目,縮小搜尋結果範圍。
  • 排名和個人化:Vertex AI Search 電子商務套件會根據關聯性和潛在收益,自動調整搜尋結果的排名。個人化功能會根據個別使用者行為進一步調整搜尋結果。

    # 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)

如要使用搜尋功能進行基本查詢,包括文字查詢搜尋、瀏覽搜尋、分頁、最佳化和個人化結果,請參閱「取得搜尋結果」。

設定瀏覽

瀏覽的使用者事件應包含下列欄位,以及使用者事件的其他標準必填欄位 (瀏覽事件也適用):eventType = "search"

  • 網頁類別:代表產品顯示的類別或橫幅。
  • 必要篩選條件:定義產品納入瀏覽結果的條件。確保類別中只顯示相關產品。
  • 使用側選單進行額外篩選 (選用):讓使用者進一步篩選類別中的產品。

    # 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)

如要瞭解如何為特定使用者和使用者事件要求產品建議,請參閱「取得建議」。