The next couple of posts will focus on SharePoint Search in Contract Lifecycle Management scenarios. This post demonstrates how to use SharePoint Search Refiners to narrow down Search Results on sales contracts in a CLM SharePoint site. Results will be refined by Sales Contract Stage and Customer Name.
The previous post covered how to use workflow to push the Sales Contract Title property into documents’ hidden Title property. The previous steps were taken so that Search results could be queried by Title instead of Name:
But, why/how is Title being rendered by SharePoint Search in the results and the Word Document Hover Panel as shown in the example above?
Title is “Indexed” by SharePoint Search because it was default defined as a “Crawled Property” in the SharePoint Search Schema. Furthermore, it is a managed property. That makes it available to be rendered in Search components such as Search Results and the Word Document Hover Panel.
- Many pieces of content in lists and documents are consumed and made available to SharePoint Search. This content is said to be Indexed in Search.
- Some of that content is given priority in Search Results after it is promoted in the Search Schema to a Crawled Property.
- That Crawled Property can then be turned into a SharePoint Search super-citizen, and made available to special Search tools, when it is yet further promoted to a Managed Property.
As a managed property, Title shows up in the Word Document Hover Panel. Similarly, “Result Type”, “Author”, and “Modified date” are showing-up in the left hand SharePoint Search tools called “Refiners“. You can click, show/hide, use slider bars, and interact with these values in the refiner tools. As a result, Search Results returned from the query Search Box query are quickly filtered.
The other properties we want to use as SharePoint Search Refiners must be “manually” promoted to manged properties.
SharePoint Search Refiners – Crawled Properties
Site Columns are automatically promoted to Crawled Properties in SharePoint. They are also promoted into Managed Properties by default in some cases.
The Content Types and Site Columns for this demonstration were covered in previous blog posts. Your Search Schema should look nearly the same if you’ve been following the series. The Site Collection level Search Settings are captured below:
Sales Contract Stage and Customer Name need to be set to refinable Managed Properties. Afterwards, they will be available for the SharePoint Search refiner web parts and refined queries.
Setting SharePoint Search Refiners Managed Properties:
As an independent exercise, you should also map “Expire Date” to RefinableDate00 before continuing:
SharePoint Online will take some time to pick-up the new managed property mapping and populate it with values from all of the sales contracts. Subsequent continuous crawls and property updates usually occur with an hour-or-two after the initial crawl completes.
Add the SharePoint Content Search Web Part
Create a new page and add a Content Search Web Part (a.k.a. CSWP).
There’s a lot of moving parts here, including creating custom queries.
After the dialog loads, restrict the results to just “Sales Contracts”:
The default results need to be updated:
Fix the output display by making the following changes to the CSWP properties.
A couple of notes:
- Titles and Sales Contract Titles are showing up as mixed results because SharePoint Search hasn’t finished indexing all content after running the OnCreated Workflow demonstrated in the previous post.
- The date stamp for RefinableDate00 (i.e. Expire Date) has time included. That’s not optimal. We’ll see how to remove the time value in a future post.
Almost there…let’s see how to make two advanced updates to the CSWP query.
Using the Content Search Web Part Advanced Mode Properties:
Click the “Change query” button on the CSWP properties dialog, and click the “Switch to Advanced Mode” label under “Basics”:
Change the query to the following. The “ContentTypeId” value will be different in your system. This query is pulling in anything under the current site, with the content type matching that of “Sales Contracts”. It also filters where the Expire Date is greater than or equal to today:
Sorting by Refiners
Switch to the “Sorting” tab by changing to Advanced Mode. Afterwards, sort by the Expire Date in Ascending order so that Sales Contracts which expire the soonest will appear at the top of the search results.
Here are the results:
Adding the SharePoint Search Refiner Web Part:
Add the quick refiner controls to the page. These controls will let users filter results by Customer Name and Sales Contract Stage with the click of a button..
Finally, a simple clean-up to the page and the Current Navigation links:
Thanks for reading.