Skip to main content

Dynamic Content Search- sorting

Release date: 17th June 2020

In this release we've made some more improvements to Dynamic Content Search to make it easy to implement sorting and give your users different ways of sorting their search results.

You can also now view information about your index including the number of records and average record size.

On this page we'll give you an overview of the new features.

Adding a sort option
Link copied!

To implement sorting you need to to add one or more sort options to your index.

Choose the "Add sort option" button at the top of the index window to add a sort option.

Click the Add sort option button to being to add a new sort option to your index

Choose the property by which you want to use to sort. In the example shown below, the search index is used for blog post content and we want to provide users with the option to sort blog posts by the date they were created. We'll choose the "dateAsTimeStamp" property.

Choose the property to sort by. Only number or boolean properties can be used

The next step is to choose the sort option: either ascending or descending. We'll choose ascending order.

Click the "Save and continue" button to update the index using the selected sort option.

Dynamic Content Search takes care of everything behind the scenes and it's easy to include the sort options in your front end code.

In the example shown below, the blog post search results can be sorted in ascending and descending order by date.

An example of using sort options from front end code. This is based on the Algolia Instant Search example

Search index statistics
Link copied!

You can now view statistics about your search index at the top right of the window.

Search index statistics

The following values are shown:

  • Number of records.
  • Average record size. A warning is displayed when the average record size is greater than the maximum recommended record size of 5KB.
  • Average response time for the last 30 days.
  • Number of searches in the last 30 days.

For more information see the search index overview page.

Search index overview