Question

enter image description here

I've created a search page that has a couple of refiners. I've also created a display template that shows search results on a table-like format. Each search result row shows the following three properties: Title, Section, Date.

Is there anyway way I can implement a dynamic order by on the results by Section or Date (i.e. clicking on the Section or Date header would change sort order)? I already am using one result source that just has the default order by.

Was it helpful?

Solution

Each property that you want to be Sortable must be a Managed Property that is Sortable. In SPO you need to map your property to a Refinable(TYPE)## managed property since they are already flagged as sortable. Then in your search results web part add those properties as Sortable Properties in the UI. This will give you a drop down for each property you specify.

I show how to do this near the end of this video. Build an Employee Directory in SharePoint Online and SharePoint

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top