Resources Relevance & Tuning

Configuring Custom Ranking for Business Relevance

Learn how to configure custom ranking

Configuration 

  1. To configure custom ranking for business relevance:
    • Go to the Index page in the Algolia dashboard
    • Select the index which you want to configure
    • Go to Configuration
    • Select Ranking and Sorting
    Custom Ranking
  2. To add a custom ranking attribute, click Add custom ranking attribute
  3. If you add custom ranking attributes, they appear at the bottom of the Ranking and sorting list. Select the desired sort order for each attribute: ascending or descending.
    Custom Ranking
  4. Optional: set up different custom ranking criteria for different indices, for example, to use different sorting strategies
    Ranking Criteria
  5. Review and save the configuration

Examples of custom ranking strategies

There are several strategies for setting up custom ranking. Which strategy you should choose depends on how often your data changes and how many pieces of data there are.

Note

To implement custom ranking, you need to collaborate with your data engineering team.

Reducing granularity of custom ranking values

If you want to use multiple custom ranking attributes to get a good mix of results, you should reduce the granularity of each attribute, or the other attributes may never be used.

To reduce the granularity of your custom ranking attribute, you can:

  • Create tiered buckets (data binning)—create a tier for each value and send Algolia the tier each record belongs to. This is especially useful for values that are close together.
  • Use logarithms—logarithms make differences between values smaller, allowing them to be binned together. This reduces granularity when the range of an attribute is large.

Embedding business logic in the custom ranking

You can tweak the custom ranking according to your business needs by embedding business-relevant attributes as custom ranking attributes. For example a ranking based on:

  • A brand, for example,  myBrand: true
  • A category, for example,  organic: true
  • Availability of stock, for example,  inStock: true
  • Sales margins, for example,  desc(salesMargin)
  • Internal popularity metrics, for example,  sold_last_month , or  sold_past_week