Appearance
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 - e.g. 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, i.e. anything not covered by the ProductAttributeSorting
sorting type.
This sorting type supports numeric values and string values, but does not support, e.g. string lists.
It is furthermore possible to define whether the sorting data exists on variant or product level.
Use case 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
This is the default product 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.
It is recommended to always use ProductRelevanceSorting
as your fallback for other product search sorting types, to ensure you get the most out of your Relewise personalization.
If, for instance, you are sorting by price, enabling the relevance sorting as a fallback allows Relewise to sort products that have the same price, based on user preference.
Below are a few cases to help illustrate when product relevance is taken into account and what actions will affect a user's relevance sorting.
Case 1
The user visits a product details page (PDP) for a garden hose product.
The user then searches for "garden equipment".
The search results will now favor garden hoses, because the user has shown a previous interest in these types of products.
Case 2
The user visits a product details page (PDP) for a speaker, and adds it to their basket.
The user then searches for "stereo".
The user will now be presented with stereos that more closely match the speaker they have added to their basket, because other users have purchased those stereos with the specific speaker in the basket.
Case 3
The user visits the product details page (PDP) for a shirt, and adds it to their basket.
The user then searches for "vest".
The user will be presented with vests that are similar in style to the product in their basket - because other users have looked at vests in a similar style after having looked at the shirt in the basket - as well as vests that complement the shirt, because other users have purchased those vests with the shirt in the basket.
ContentRelevanceSorting
This is the default content 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.
It is recommended to always use ContentRelevanceSorting
as your fallback for other content search sorting types, to ensure you get the most out of your Relewise personalization.
ProductVariantSpecificationSorting
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.
ProductVariantAttributeSorting
This sorts by the standard attributes in Relewise, i.e. Id, DisplayName, BrandId, BrandName, ListPrice, SalesPrice, but looks at the variant rather than the main product.
ProductDataObjectSorting
This sorts according to data found in an Object List, such as a price or price range nested within a Data Object List.
This is useful for, e.g., sorting by lowest price among a series of prices listed on the product, according to certain criteria such as date interval.
Use case example
Your product prices vary between countries, and each product may have several prices active at once. These prices are stored in a DataObject List, from which you retrieve the lowest active/relevant price to be used for sorting purposes.