How to create custom refiners in SharePoint Online

A common requirement for SharePoint (Online) is to have custom refiners especially since search is getting more and more the preferred way of creating solutions. One reason is to be able to cross the Site Collection boundaries. This is how you configure custom refiners in SharePoint Online:

  • Create site columns. This can be done at the root site, but just as well on a subsite. Give the site columns a prefix so that they can be found more easily in the crawled properties. After they are created, they can be renamed which is more user friendly.

Image

Image

  • Create a list and add the site columns. Of course you can also first create a content type, add the columns to the content type and add that content type to the list. Be sure to add some items to the list.

Image

  • Reindex the list and the site. I am not sure if this is really needed, but it doesn’t harm the index process. The site columns need to be picked up by the crawl engine. The scheduled is planned for every 15 minutes so after that time the crawled properties should be available in the search area of SharePoint Online.
    • Go to the list settings and choose advanced settings

Image

Image

    • Go to the Site settings and choose Search and Offline availability

Image

Image

  • Go to the SharePoint admin center and select Search from the left menu. Select Manage Search Schema

Image

  • Select Crawled Properties and search if the site columns are already available

Image

  • Go to Managed Properties and search for the first available RefinableString which is one which doesn’t have a mapped crawled property. It is not possible to set the property Refinable to Yes for a custom Managed Propery therefore you need to use one of the already created Managed Properties which start with “Refinable”.

Image

  • Map the Managed Property to the Crawled Property

Image

  • The result should look like this

Image

  • Create a page with a Search results web part where only the results from the list are shown.

Image

  • Add a refinement web part to the page and choose the custom refiners. Set the Display name to the name of the column in the list

Image

  • It can take a while (in my case about a half hour) before the refiners are visible. But it is worth the wait:

Image