Guides / Solutions / Ecommerce / Business user guide / Initial configuration

Configuring custom ranking for business relevance

The ranking attributes need to be preconfigured by your data engineering team.

To configure custom ranking for business relevance:

  1. Go to the Index page in the Algolia dashboard
  2. Select the index which you want to configure
  3. Go to Configuration
  4. Select Ranking and Sorting

    configure relevance in the ranking and sorting section of the dashboard

  5. To add a custom ranking attribute, click Add custom ranking attribute
  6. 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.

    add custom ranking attributes in the dashboard

  7. Optional: set up different custom ranking criteria for different indices, for example, to use different sorting strategies

    Use different custom rankings for different ranking strategies

  8. Review and save the configuration

For more guidance on configuring relevance, visit the Algolia Academy.

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.

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
Did you find this page helpful?