SharePoint 2013 : How to Create Custom Intent Based Results Blocks Using Query Rules

In this post we will explore a new mechanism of Searching data based on Custom User Intents and serve them as Result Blocks on top of the Search Results.

What is Custom User Intent?

Custom User Intent means matching a Search Term specified by the end user with the Phrases defined using Query Rules. For example, PowerPoint Slides are also known as Decks. So if the business user specified a Search Term as “SharePoint Deck”, it was really intended to search all the PowerPoint Slides which contains “SharePoint” as shown in the image below.

1

Hope the above example suffices to clarify the Custom User Intent.

Business Scenario

For the sake of this demo, I have setup an imaginary scenario, where in my organization business users refer all types of videos as “Small Medium Sized Video” or “SMV”. As the matter of habit all users make use of keyword “SMV” in order to search for video files in SharePoint System.

In order to implement the Custom User Intent based on above scenario we have to follow the below steps:

  • Go To “Site Settings”

2

  • Under “Search” section Click on “Query Rules”

3

  • Create & Configure Query Rule
  1. Select the required “Result Source”, in our case we can go with “Local SharePoint Search Results”.
  2. Click on “New Query Rule” in order to create a new Query Rule.
  3. Specify rule name as “Custom Video Intent”
  4. Under “Query Conditions” “Query Contains Action Term” and specify the phrases you want to match to identify the User Intent, like we specified as “smv;smvs”.
  5. Click on “Add Result Block” to specify the query based on which Result Block will be rendered.

4

5

6

  • Configure Result Block
  1. Specify the “Block Title” as shown below
  2. Click on “Launch Query Builder” button to configure the query

7

  • Configure query
  1. Select result source “Local Video Results”
  2. Click on “Test Query” button to test the query based result source selected in Step 1
  3. “Search Result Preview” Section on the right will show the results returned as a part of the query specified earlier.
  4. Click “OK” to save the Query Changes.

8

  • Configure Display Template

Choose suitable Display Template from “Item Display Template” dropdown list.

9

10

And that’s it. We are all done with our new Query Rule defining Custom User Intent.

 

11

Now it is time to see the Query Rule in Action. In order to test it go to Search Center and enter “SharePoint smv” as search term and click Search Icon. You will see the Search Results Block “Video Results for SharePoint” containing items which contains “SharePoint” in their Title or Description.

12

Hope this will help someone in need…

Advertisements

One thought on “SharePoint 2013 : How to Create Custom Intent Based Results Blocks Using Query Rules

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s