Yesterday I was asked about how to sort Documents in the Highlighted Content web part by the Title property. To sort by Title you will have to go through some extra steps.
SharePoint Search web parts
First I would like to take you through some history.
In the year 2016, I wrote a blog post about making the Title field sortable in the classic SharePoint search web parts. And for the Highlighted content web part we have to roughly go through the same steps.
SharePoint Search hasn’t changed very much and the important thing to notice is that the Title Property is still not sortable.
So when you try to configure the Highlighted Content web part the Title property will not appear.
And you still can’t make the Title sortable
Make the Sort by Title work
First of all I’m going to have a look at the Title Managed property. This property is mapped to quite a few crawled properties.
Using the above I would like to create a new mapped property and make it Sortable …
But the Sortable option here is also not enabled.
Back to my post from 6 years ago.
Using RefinableString Properties
In the managed properties there are pre-created properties that are sortable, but not mapped. We are going to make sue of these.
So first pick one of the refinable string properties that isn’t yet in use. I’m going to use RefinableString00
Now edit this property and all the way at the bottom of the settings you will find the following place to add mappings.
In this truly horrible UI, add the following properties:
- and all the other properties found withing the Title Managed Property
Once that is done we have a managed property.
Now we can go back to the Highlighted Content web part. But as you try to find RefinableString00 you will very quick discover that this property is still not available. SharePoint is being ‘clever’ as the property was sortable in the part but not used it is not available to search based web parts.
Now go to your site settings and find the option Search and Offline Availability
And hit the Reindex site button!
Now wait a little while as the reindexing starts. This should be quite quickly.
And now the RefinableString00 property is available to be selected and my Documents are sorted by the Title.