Being able to refine a search result is a feature that is widely used, and necessary when handling large sets of search results. Refining makes you able to narrow down the result set, making it easier to find what you are looking for. Faceted Navigation is the ability to define different refiners for different terms in the taxonomy in a product catalog. In other words having different refiners for different product categories. In my example I have a company, Contoso Electronics Superstore, selling different electronic equipment (Audio, cameras, computers, home appliances, phones and TV&Video). For all categories I have defined the refiners Price, Brand and Color. For the sub category Televisions (a part of TV & Video) I would like to add the refiner Screen size as well.
In this blog post I will show you how to configure Faceted Navigation for a Product Catalog set up in SharePoint 2013.
Configuring Faceted Navigation is done in the site collection where the product catalog is created. Navigate to Site settings => Term store management. In the left side column, navigate to Site collection => Product hierarchy. In the tab Intended use, select the checkbox Use this Term Set for Faceted Navigation. Then click Save. You have now enabled the term set for this product catalog for Faceted Navigation, and the necessary UIs will be enabled.
In order to see refiners, let’s add the refiner web part to the category page in the product catalog. On the site collection containing the public facing web site, navigate to a category page. In Site settings => edit page => edit page template: Add the web part Refinement from the Search category,In this web part, navigate to Edit web part, and in the Refiners section, select the option Use the refinement configuration defined in the Managed Navigation term set.In the Refinement Target section, choose the ContentBySearch web part that is displaying items on this page. In this example: Targeted content search.
Then click OK to save the web part configuration. Save the page.
Let’s go back to the site collection that contains the product catalog list. In Site settings, navigate to term Store management.On the left side column navigate to the top term in the product catalog: Site collection => Product hierarchy => Electronics. Click on the Faceted Navigation tab. Then click on the button Customize refiners.
The Refiner configuration pop-up will be displayed. This is where we set the refiners. Since I’m currently on the root term of the product catalog, all child nodes will inherit the refiners I’m configuring her.From the menu Available refiners, select the refiners RetAdjustedPrice, RetBrand and RetColor. These are the managed properties I want to use as refiners. Use the Add button to move the selected refiners over to the Selected refiners window.
Each refiner can be configured differently and the different refiner types (Text, Int, Decimal and DateTime) will have different configuration options. A preview of the end result can be displayed by clicking on the Preview refiners button. Click OK to save the refiner configuration. These refiners will show up on every page in the product catalog.
Change the name of the refiners by editing the file \\<servername>:port\sites\<site collection name>\_catalogs\masterpage\display templates\language files\en-us\CustomStrings.js
Add the following lines in the file: "rf_RefinementTitle_RetBrand": "Brand", "rf_RefinementTitle_RetColor": "Color", "rf_RefinementTitle_RetAdjustedPrice": "Price", Save the file and refresh the category page:
So far, we have only configured refiners to our terms. Now is the time for Faceted Navigation. As I stated in the beginning of this post, faceted navigation is the ability to set different refiners for different terms. I will now demonstrate how to set refiners that will only take effect on one term. For the term Televisions I will add a refiner for Screen size.In the site collection where the product catalog list is stored, navigate to Site setting => Term store management. Navigate to the term Televisions, click on the Faceted Navigation tab. Click on Stop inheriting. This action is needed to be able to configure refiners that will be visible on this term only.
Then click Customize refiners. In the Refinement configuration popup, find and select RetScreenSizeOWSNMBR from the Available refiners list. Click Add and then OK.
Then click Save in the Faceted Navigation tab to store the configuration.Change the name of the refiner from RetScreenSizeOWSNMBR to “Screen Size”, by editing the file \\<servername>:port\sites\<site collection name>\_catalogs\masterpage\display templates\language files\en-us\CustomStrings.js
Add the following line in the file: "rf_RefinementTitle_RetScreenSizeOWSNMBR": "Screen Size", Save the file.
On the Site Collection containing the public facing web site, navigate to the category page TV&Video=>Televisions. The refiner “Screen Size” will only be visible in this sub category.