Xceedas

Xceedas
xceedas

Saturday, 20 September 2014

Terms as Search Refiners in SharePoint 2013

Introduction
In this article we can explore how to convert Managed Metadata Terms into Search Refiners. 

Problem
The following is our Term Set.

TermSet
We need to show it as Search Refiners.

Search refiners
The procedure is summarized below.
  1. Create Terms
  2. Create List
  3. Create Data
  4. Full Crawl
  5. Create Refiners
  6. Create Search Center
  7. Modify Results Page
  8. Test Search
Procedure
Please use the following procedure to do it.
Step 1: Create Terms
Open Site Settings > Term Store Management Tool and create the following Terms.
Term Store Management Tool
After the term creation, we need to modify the Intended Use properties too. Select the Term Set and set the following properties to true.
Intended Use
Save the changes. Now you are ready to move to the next step.
Step 2: Create List
Create a new list named Consultant of type Custom List and add the following properties:
  1. Name (text)
  2. Qualification (text)
  3. Skill (Map to Term Set Skill)
Columns
Step 3: Create Data
Populate the data into the list.
Consultant
Step 4: Full Crawl
We need to do a Full Crawl now. Open Central Administration then select "Service Applications" > "Search Service Application" > "Content Sources". Select the content source and choose Start Full Crawl.
Wait for a few minutes for the crawl to be completed.
Step 5: Create Refiners
Now the search system should have identified our new columns, but they are just crawled properties. We need to convert them to Refiners.

Open the Search Schema page from the Search Service Application page.
Search for the property named Skill and you should get the following results with owsTaxIdSkill. The prefix ows is added for automatically generated properties. Here the property is generated from our Skill column.
Filter
Click on the owstaxIdSkill property and you will get the following page.

owstaxIdSkill

Scroll down and mark the following properties to Yes.
  1. Refinable
  2. Sortable
Refinable Sortable
We need to map the property to the following ows_Skill as shown below. Scroll down and choose Add a Mapping to find and add the property.

Add a Mapping

Save the changes. Do a Full Crawl now.
Step 6: Create Search Center.
We need to create a custom search center site now. This is to get an editable search results page.

Go back to the SharePoint site and do the following:
  1. Activate Publishing site collection feature
  2. Create a new site of template Enterprise Search Center
Select a Template
Open the Search site and enter the text MCA based on your qualification data.
MCA

Click on the Search button and you should be seeing the following results page.
Result Page MCA
Step 7: Modify Results Page

Now we have a results page that can be modified. Choose the Edit Page option. You will get the following view.

Edit Page

Select the Refinement web part and choose Edit Web Part. In the appearing section towards the right-click theChoose Refiners button.

In the appearing dialog find the owstaxIdSkill property that we marked as Refinable. We can only get the property here once it is marked as Refinable.

Refinement

Add the property to the right panel and change the following properties as shown above:
  1. Display name to Skill
  2. Display template to Multi-value Refinement Item
  3. Sort by to Name
  4. Sort direction to Ascending
Click the OK button to save the changes. Click the OK button for the web part. Save the changes to the page too.
Step 7: Test Search

Now we are ready to test the search. Refresh the Search Results Page and you should be seeing the Skill refiner to the left as shown below. 

Search Result Page

Select a skill and click the Apply link. You can see the results that were refined to the right.

Apply Link

You can see the Terms as Search Refiners now. This concludes our article.

Note:
If you experience any page refresh problem I would advise to do an IISRESET and browser cache clearing for retrying.

No comments :