Who ever have used SharePoint OOB search might have observed a refinement panel on the left side where by default SP will list out possible list of FILTERS based on the content it has crawled. Like File Type refiner, User refiner, Time stamp refiner & so on….
What if you need a custom refiner in the left navigation which filters search results?
Below steps will explain the same.
Before jumping in, refiners are nothing but the column values of different records that are aggregated by SP & stored in the DB. These will be used like filters during searches. Like for OOB refiner “File Type”, the values will be DOCX, PPTX, XLSX..
And for the sake of maintaining standards, I am using Term store here.
- Create a term set & term (Policy Types) with terms as HR, finance, IT..
- Create a new site column (PolicyType) mapping to the above term set
- Let there be a new document library with new site column
- Fill up the library & add N number of rows
After some time SP might have automatically created a Crawled property for us based on the new site column. We can use it or just create a new managed property mapping. We shall do the later just because we can.
- Go to Central Admin — Service Applications — Search Service application CLICK
- Click Search Schema — Click New Managed Property
- Give below details in the screen & submit
Refinable: Yes – Active
Sortable: Yes – Active
Allow Multiple: NO
- Now start a FULL search crawl & wait till it finishes.
- Go to the SearchResults_documents.aspx & keep it in EDIT mode
- Go to the web part properties of the REFINERS web part
- In properties window, click on CHOOSE REFINERS
- Select “MYPolicyType” from left list box & move it to right
- At the bottom, use below values
- Display Name: Policy Type
- Display term: Refinement Item
- Click OK
- Save & Publish the page.
I would like to thank below URL where OOB crawled propertie is used which is again a good IDEA if you are planning to have many search schema level items.