Skip to content

Instantly share code, notes, and snippets.

@gcsfred
Created February 3, 2020 15:49
Show Gist options
  • Save gcsfred/7e9feaa00dc8bca3b6c5bf4658bd2d73 to your computer and use it in GitHub Desktop.
Save gcsfred/7e9feaa00dc8bca3b6c5bf4658bd2d73 to your computer and use it in GitHub Desktop.
Search with personalization (fragment)
def search_with_personalization(user, search):
config = configparser.ConfigParser()
config.read('config.conf')
categories = get_category_recommendations(config, user)
ranked_categories = get_category_ranking(config, user, categories)
products = get_product_recommendations(config, user)
ranked_products = get_product_ranking(config, user, products)
query_es(search, ranked_categories, ranked_products)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment