One of the best new features of SharePoint 2013 Search is the introduction of Query Rules. Query Rules in SharePoint 2013 replaces the Best Bet functionality in SharePoint 2010.
Query Rules allows us to create:
- Result Blocks
- Promoted Results
- Change Ranked Results
- Act on user “Intent”
Act on user “Intent”
Act on user intent is all about searching in a natural way. It means mixing our natural vocabulary with search queries.
Most of us refer to PowerPoint presentations as “Deck” and Word documents as “Doc”. In SharePoint 2010 search, when we want to search for any Word or PowerPoint content, you need to first search by giving the search query and then refine using file type.
What if we want to combine our natural vocabulary with search keywords? For example, what if I issue search queries such as “SharePoint deck” and “SharePoint doc” trying to locate Word or PowerPoint content which contains SharePoint keyword? In SharePoint 2010 search, it will search for content which contains “SharePoint deck” and “SharePoint doc” within the content. It doesn’t understand that “deck” and “doc” are two words we use in our day-to-day vocabulary. But in SharePoint 2013, if you search by giving “SharePoint deck” and “SharePoint doc”, it will return Word and PowerPoint content which contains “SharePoint” keyword within the content. SharePoint 2013 understands that “deck” and “doc” are two words which we use commonly in our day-to-day work.
Following is a screen capture of a search result without using any user intent:
Following is a screen capture of a search result with the use of new SharePoint 2013 Search user intent features:
“Deck” and “doc” are two built-in user intents provided by SharePoint 2013 Search. We also can introduce custom user intent with the help of new Query Rules concept.
Adding custom user intents
We often refer images as “pics”. It will be very convenient for end-users for being able to search for images by combining “pics” user intent rather than searching and then refining using file type search refinement.
Following is a screen capture of a search result which gives no results when you use “pics” user intent since “pics” is not a built-in search user intent rule and it’s trying to search for content which contains “sharePoint pics” within the content:
Following steps demonstrate how we can get custom user intents integrated to SharePoint 2013 search.
Task – Creating a custom User Intent Query Rule
- Navigate to your Search Center. In my case, it’s http://intranet.team.com/search
- Click Settings from top-right corner and select Site Settings to navigate to Site Settings page.
- Select Search Query Rules from the Site Collection Administration section to navigate to Manage Query Rules page
- Select Local SharePoint Results (System) for For what context do you want to configure rules? parameter and click New Query Rule to open Add Query Rule page.
- Give a Rule Name, and select Query Contains Action Term for Query Condition. Enter “pics” for the option Action term is one of these phrases
- Select Add Result Block under Result Blocks in Actions section to open Add Result Block dialog box
- Amend the Block Title and click Launch Query Builder to open Build Your Query window.
- Select Pictures (System) for Select a query option and click Test query button and observe the SEARCH RESULT PREVIEW
- Click OK to go back to Add Result Block dialog. Change the Items value depending on how many items you need to show in the search result.
- Click Settings link to expand Settings section. Select Picture Item for Item Display Template and click OK.
- Click Save to exit from Add Query Rule page