Skip to main content
Personalization gives users custom rankings based on their past behavior. A user’s behavior reveals their preferences and interests. Algolia calls these “affinities.” This guide explains how Algolia calculates user affinities from user behavior. It also explains how Algolia applies affinity scores to results.
This feature isn’t available on every plan. Refer to your pricing plan to see if it’s included.

Define user affinities based on facets

Basing Personalization on individual items is wasteful. Users tend to have affinities for categories of items, not particular items. For example, a user may have an affinity for athletic wear when shopping for clothing, for non-fiction when browsing books, or for pop music when listening to music. These different categories correlate with facets in your data. Algolia’s engine needs to know which facets your user has an affinity for. This lets it personalize search results. Personalization relies on facets to understand user affinities and promote results accordingly. Take an online media store as an example. To personalize search results, look at the genres, authors, and artists behind the media a user has consumed. These matter more than individual titles. When the engine knows the categories a user likes, it can personalize results. It bases these results on the user’s affinities. It does so by boosting the corresponding facet values. Consider a user who purchased children’s books and other media in the past. Suppose they search for “poetry”. In that case, the engine can return book results from Shel Silverstein, Dr. Seuss, and other children’s poets. Take another user who has shown an affinity for Korean film. For this search, the engine can boost the 2010 Korean drama “Poetry.” In both cases, textual relevance is the first step. But personalizing results depends on the facets in the user’s past behavior.

Translate user behavior into affinities through events

Users’ behaviors, both search and non-search related, give insight into their affinities. Meaningful behavior includes when a user views, clicks on, likes, favorites, bookmarks, or purchases an item or category. When a user interacts with an item or category, the engine looks at the facet values that represent it. This helps the engine understand the user’s affinities. User behavior reaches Algolia in the form of standardized events. Each time a user takes a meaningful action, send an event to Algolia. The engine uses it to build that user’s affinity profile. To build the most nuanced, relevant user profiles, gather as much data as possible. To decide which events matter, see Plan which events to send. You need a large set of user data and a well-planned personalization strategy. Otherwise, Personalization may over-promote some categories over others.

Scoring

Personalization scoring has three layers:
  • Sending events
  • Building user affinity profiles based on facets
  • Applying the profiles based on your personalization strategy
Building user affinities begins with collecting events. You may collect a wide variety of events, for example, viewing a category page, clicking on a product page, liking an item, sharing an item, and adding an item to the shopping cart. Each of these events shouldn’t carry the same weight when personalizing results. For example, adding an item to the shopping cart is a stronger indicator of affinity than viewing its product page. You can fine-tune each event type’s weight in your Personalization strategy. After setting your strategy and simulating, you may also decide that certain events don’t offer any meaningful information. That’s fine. Collecting an event doesn’t mean you must include it in your strategy. Events can be item-based or category-based. Either way, Algolia always extracts the underlying facets to build user affinity profiles. The engine stores all underlying facet data from events. This lets you simulate the effect of including different facets in your Personalization strategy. In production, the engine only applies Personalization to the facets you include in your strategy. For example, a clothing store may list category, color, price, brand, material, and size as attributesForFaceting. This lets users filter on them when searching. Buying a green sweater doesn’t mean a user buys green items from now on. Brand, category, and size are strong indicators of a user’s affinities, but color may be less so. Like events, you can set each facet’s weight in your Personalization strategy, or leave facets out entirely. When ranking search results, Algolia integrates Personalization into the relevance strategy. This way, it doesn’t override the textual, business, or merchandising relevance you’ve already set up. Even so, you can change how much impact Personalization has. See the guide on configuring Personalization to set the impact of events, facets, and Personalization.

Turn on Personalization at query time

You can enable Personalization as an setting. Or turn it on at query time with the enablePersonalization setting. Before putting Personalization into production, simulate its effects in your dashboard. Then test it with the A/B testing feature. See the personalizing results guides for the implementation overview and details on each step. This includes what to do before going to production. For more information, see:
Last modified on September 16, 2026