Refining SharePoint Search Using Enterprise Keywords
If you have read anything about the latest version of SharePoint you may have heard that a lot of enhancements have been made around the out-of-the-box search features. As SharePoint consultants, our team at Rackspace is constantly discovering powerful new uses for these features every day, saving our customers time, money, and overhead. In 3 easy steps this article will give one example of how the search features in SharePoint can be used to create efficient solutions.
Note - In this example a basic web part page has been created. It contains a Content Search web part that rolls up a specific content type. To customize the default search page for a site collection an Enterprise Search Center can be created. This is a site template that is available with the enterprise version of SharePoint 2013. The directions to update the refinement panel are identical to this article. The new Enterprise Search Center site can then be set as the default search page for the site collection.
Step 1: Turn on Enterprise Keyword column
To turn on the Enterprise Keyword feature for a document library or list, access the Library/List settings page and click the Enterprise Metadata and Keyword Settings option under Permissions and Management. Then place a check in the box beside Add an Enterprise Keywords column to this list and enable Keyword synchronization and click OK. Once keywords have been populated on the documents or items the search crawl will need to run and index the information for it to become available.
Step 2: Create Managed Property Mapping
SharePoint provides us with refinable strings, dates, decimals etc. These are managed properties that are already apart of the site's search schema. Crawled properties (i.e. site columns) can be mapped to managed properties. The properties can then be used to customize the search experience.
To access these, go to Site Settings
and click Search Schema
under Site Collection Administration. Enter the name of the next available managed property in the Filter
box. For crawled properties that relate to text fields you can use refinablestring. SharePoint provides 100 of these and they are numbered. In this example, refinablestring00
have already been used, so refinablestring02
can be entered into the Filter box as it is the next available.
Hover over the name of the managed property and click Edit/Map property. On the managed property settings page scroll down to the Mappings to crawled properties section and click Add a Mapping.
Use the search box to locate the crawled property that needs to be mapped. In the example we are looking for the crawled property called Keywords
as this represents the Enterprise Keywords that have been entered on the site. Click OK
Scroll to the Alias
section and give the managed property a descriptive name so it can be easily identified. Click OK
at the bottom of the managed property settings page.
Step 3: Add Refinement web part to page
A page has been created that has a Content Search web part
that is rolling up all documents of a specific content type. All of these
documents have been tagged with Enterprise Keywords.
To add & configure the refinement panel the page should be in Edit
mode. Use the Insert
tab on the ribbon to select Web Part
. The Refinement
web part can be found under Search. Click Add
The Refinement panel will automatically connect to the Content Search web part. Edit the Refinement web part and click on the Choose Refiners…
button in the web part properties window.
The Refinement panel will contain some default refiners these can be removed by using the <Remove
button. To allow users to refine the Content Search web part by Enterprise Keywords the refinablestring02
managed property needs to be added to Selected refiners. Scroll through the Available refiners
list and then use the Add>
button to move refinablestring02
The Refinement Configuration page will show you a preview of the results for the selected refiner as well as its aliases. A display name can be added and the display template and sorting can also be customized for the refiner. Click OK
on the Refinement Configuration page and then click OK
on the web part properties box. Save & Check In
the page as needed.
Notice that the page has a functioning refinement panel. Users can now easily refine the content being returned in the Content Search web part by corresponding Enterprise Keywords!