Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 50 additions & 4 deletions sql/mozfun/norm/result_type_to_product_name/udf.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ RETURNS STRING AS (
WHEN res IN ('rs_amo', 'rust_amo')
THEN 'suggest_add_on'
WHEN res IN ('search_suggest', 'search_history', 'search_suggest_rich')
THEN 'default_partner_search_suggestion'
THEN res -- previously 'default_partner_search_suggestion'
WHEN res IN ('search_engine')
THEN 'search_engine'
WHEN res IN ('rust_yelp', 'ml_yelp')
WHEN res IN ('rust_yelp', 'ml_yelp', 'merino_yelp')
THEN 'yelp_suggestion'
WHEN res IN ('rust_fakespot_amazon', 'rust_fakespot_bestbuy', 'rust_fakespot_walmart')
THEN 'fakespot_suggest'
WHEN res IN ('trending_search', 'trending_search_rich')
THEN 'trending_suggestion'
WHEN res IN ('history')
THEN 'history'
WHEN res IN ('bookmark', 'keyword')
WHEN res IN ('bookmark', 'keyword', 'restrict_keyword_bookmarks')
THEN 'bookmark'
WHEN res IN ('tab')
THEN 'open_tab'
Expand All @@ -41,7 +41,7 @@ RETURNS STRING AS (
THEN 'wikipedia_enhanced'
WHEN res IN ('dynamic_wikipedia', 'merino_wikipedia')
THEN 'wikipedia_dynamic'
WHEN res IN ('weather')
WHEN res IN ('weather', 'merino_weather')
THEN 'weather'
WHEN res IN (
'action',
Expand All @@ -55,6 +55,52 @@ RETURNS STRING AS (
THEN 'pocket_collection'
WHEN res IN ('rs_mdn', 'rust_mdn')
THEN 'mdn'
WHEN res IN ('rust_vpn')
THEN 'vpn'
WHEN res IN ('remote_tab')
THEN 'tabs'
WHEN res IN ('calc')
THEN 'calculator'
WHEN res IN ('tip_onboard', 'tip_redirect', 'tip_persist')
THEN 'tip'
WHEN res IN ('autofill_about')
THEN 'about_autofill'
WHEN res IN ('autofill_adaptive')
THEN 'adaptive_autofill'
WHEN res IN ('unit')
THEN 'unit_converter'
WHEN res IN ('fxsuggest_data_sharing_opt_in')
THEN 'online_suggest_opt_in'
WHEN res IN ('merino_polygon')
THEN 'merino_market_opt_in'
Comment on lines +74 to +75
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rust_market_opt_in will be the opt-in for market suggestions

merino_market will be online suggestions once the user has opted in

We'll follow that pattern for other opt-in and online suggestions, e.g., rust_yelp_opt_in and merino_yelp.

WHEN res IN ('tab_serp')
THEN 'open_tab_to_serp'
WHEN res IN ('merino_market')
THEN 'market'
WHEN res IN ('merino_sports')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is right for online sports, and just to reiterate the opt-in will be rust_sports_opt_in

THEN 'sports'
WHEN res IN ('merino_flights')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly here, the opt-in will be rust_flights_opt_in

THEN 'flights'
WHEN res IN ('rust_important_dates')
THEN 'important_dates'
WHEN res IN (
'top_site',
'recent_search',
'history_serp',
'history_semantic',
'history_semantic_serp',
'url',
'tab_to_search',
'tab_semantic',
'tab_semantic_serp',
'clipboard',
'restrict_keyword_history',
'restrict_keyword_tabs',
'restrict_keyword_actions'
)
THEN res
WHEN res LIKE('rust_%_opt_in')
THEN SUBSTR(res, 6)
ELSE 'other'
END
);
Expand Down