Sorting

By default, the search results in Sitecore Search are sorted in descending order of relevance, with the most relevant result appearing at the top. You can define different sorting methods by configuring sorting options. You can then make them available in the UI so your site visitors can change the order of results.

You can create a sorting option using one of the following:

  • Algorithmic sorting - uses the same method of sorting as the default (descending by relevancy score).

  • Attribute sorting - orders search results using an attribute such as ratings, title, or date last modified, in either ascending or descending order.

In the following image shows some Sitecore.com search results alongside three methods for sorting them: Relevance, which is created using algorithmic sorting; Oldest content, which sorts by date last modified attribute values in ascending order; and Newest content, which sorts by date last modified attribute values in descending order.

Search results with "Sort by" highlighted. The sorting options are Relevance, Oldest content, and Newest content.

You can add sorting options on the Feature Configuration tab in the Domain Settings section of the Administration page.

Tip

If you want visitors to be able to sort by statistical information such as most viewed or most clicked, you can create a sorting option using the inner attributes from the rfk_stats composite attribute.

Any time you add a sorting option, you can add a second option as a tie breaker. This is useful for attributes where multiple content items have the same value. With these attributes, you might want to add a secondary option that uses algorithmic sorting. This secondary option uses relevancy scores to break ties between content items with the same value for the attribute, causing the more relevant items to be shown higher in the results list.

Important

If a request does not identify a sort option, the configured option is used.

Do you have some feedback for us?

If you have suggestions for improving this article,