Skip to content

Sorting Searches

As a rule, Relewise recommends not imposing additional sorting types onto the search results we return, as the results are returned in descending order of relevance based on the behavioral tracking of your users, and the accuracy of your search index.

However, you may still want to add another layer onto the search result sorting. To this end, Relewise supports several different sorting types, outlined below.

All sorting types in Relewise support sorting by Ascending or Descending - eg. from lowest to highest price, or vice versa.


Creating a Fallback for Search Sorting

We strongly urge you to enable a fallback of your sorting to the appropriate relevance sorting, to ensure that sorted results with the same value are given a secondary criterion to be distinguished by.

To enable a fallback, use thenBy to define the secondary (or tertiary) sorting type. To fall back on Relewise's relevance sorting, use either ProductRelevanceSorting or ContentRelevanceSorting, as applicable.

Sorting Types Supported by Relewise

Relewise supports the following sorting types:

ProductAttributeSorting / ContentAttributeSorting

This sorts by the standard entity attributes in Relewise, namely: Id, DisplayName, BrandId, BrandName, ListPrice, SalesPrice.

For sorting by these values on Variant products instead, use ProductVariantAttributeSorting.

ProductDataSorting / ContentDataSorting

This sorts by custom datakeys, ie. anything not covered by the ProductAttributeSorting sorting type.

This sorting type supports numeric values and string values, but does not support, eg. string lists.

It is furthermore possible to define whether the sorting data exists on variant or product level.

Usecase Example

Use ProductDataSorting to sort by a rank data field to enforce a custom ranking, and then use thenBy to sort by ProductRelevanceSorting.

ProductPopularitySorting / ContentPopularitySorting

This sorts by the popularity of entities, on the basis of an asynchronous calculation performed in Relewise's engine. By default, product popularity is defined as an equal weighting between product views and product sales. For content, popularity is based on entity views. These values look at the past 30 days to make the popularity calculation.

It is possible to customize the makeup of the popularity calculation. To do so, reach out to us via our support channels.

ProductRelevanceSorting / ContentRelevanceSorting

This is the default sorting type, and is done on the basis of our advanced personalization algorithms. The personalization looks at the behavior of the user and tries to match entities on the basis of tracked interest.

For instance, if a user adds a pair of trousers of a certain brand to their cart, and subsequently performs a product search for shirts, Relewise will attempt to return products that match the brand of the product(s) already in the cart.

It is recommended to always use ProductRelevanceSorting or ContentRelevanceSorting as your fallback for other types of search sorting, to ensure you get the most out of your Relewise personalization.

If, for instance, you are sorting by price, enabling the relevance sorting as fallback allows Relewise to sort products that have the same price, based on user preference.


This allows you to sort by the specifications of a product variant, rather than its data.

Specifications include things such as size, color, or style.


This sorts by the standard attributes in Relewise, ie. Id, DisplayName, BrandId, BrandName, ListPrice, SalesPrice, but looks at the variant rather than the main product.


This sorts according to data found in an object, such as a price or price range nested within a Data Object.

This is useful for, eg., sorting by lowest price among a series of prices listed on the product, according to certain criteria such as date interval.

Don't know us? Don't worry - you can find more information about us, by visiting our main page