SharePoint 2013: How To Create Custom Search Verticals

What are Search Verticals:

In SharePoint 2013 Search Vertical are displayed in the Search Navigation Web Part on Search Center. SharePoint 2013 Provides us four Search Verticals OOTB namely Everything, People, Conversation, Videos. Each of these verticals mapped to a specific page to display the results returned by the queries and when Search Users click on any of these verticals they are navigating to the respective mapped pages with the vertical they clicked on.

3

For example: Search Vertical Everything uses Results.aspx page to display the results returned by the query. In the similar fashion People vertical uses PeopleResults.aspx, Conversation vertical uses ConversationResults.aspx, Video vertical uses VideoResults.aspx.

All these pages used by the different Search Verticals can be located under Page Library on Search Center Site

1

Each of these vertical pages uses following four Web Parts to render results returned by the user queries:

  1. Refinement Web Part
  2. Search Box Web Part
  3. Search Navigation Web Part
  4. Search Results Web Part

2

I hope by now you got a fairly good idea on “What are Search Verticals?”

In this article we are going to create new Search Vertical for our Search Center that will be showing all the documents (Only Documents) Authored or Co-Authored by me.

Business Scenario:

  1. Search must be able to show all the documents Authored or Co-Authored by me
  2. All the search results must be shown under different vertical on the Search Center
  3. Only documents must be included in the search results

Prerequisites:

  1. Search Service Application Instance must be created and configured
  2. Content Sources must be created as required
  3. Full Crawl must be executed once at least on each of the Content Source
  4. Search Center Site must be created & configured as required

On the similar lines we can create our own Search Verticals.

We need to perform following steps to get a new Search Vertical Up and Running.

  1. Create Result Sources (One per vertical)
  2. Create new Search Vertical page to display results
  3. Configure Search Navigation

We will start our journey by creating the required Result Source for the new search vertical

Go to Site Settings

4

Go to Search >> Result Sources

5

Create new Result Source by clicking New Result Source link

6

Enter Name and Description.

Choose Local SharePoint as Protocol

Click in Launch Query Builder Button to launch Query Builder screen where we can specify the relevant query for the Result Source

7

8

Choose Property Filter as needed, based on the business scenario we have we will choose Property Filter as Author and Value as Name of the user who run the query then Property Filter as IsDocument and Value as 1.

Setting IsDocument Property Filter to 1 is a must if you want to display only documents as the part of the search results for this newly created vertical.

9

Click Add property filter Button to add the properties to the Query Text.

Once we are done with configuring the Query we need to test the Query by clicking Test Query Button

Search Result Preview Panel on the left will display all the results returned by the query we just configured.

10

Click OK

11

With this we are done with the creation of Result Source for the new Search Vertical

Now we will create new Search Vertical Page to display results retuned by the Result Source that we have just created.

Go to Site Contents

12

Go to Pages Library

13

Click new item or Go to Files Tab >> New Document

Choose Page Template to create a new Search Page

14

15

Once the page is added, Edit the page

16

Locate Search Results Web Part and edit its properties

17

18

In Web Part Properties click on Change Query Button to launch a query builder

19

Choose My Documents Result Source from Select a query Dropdown box

20

Click Test Query Button to test the query translated by the Result Source selected under Select a query

Search Result Preview Panel on the left will display all the results returned by the query we just configured.

With this we are done with creation a new Search Result Page.

It is time now to Configure Search Navigation to include new Search Vertical on the Search Center

Go to Site Settings

Go to Search >> Search Settings

21

Click on Add Link under Configure Search Navigation

22

Enter Title as My Documents

Click on Browse Button

23

Select MyDocuments.aspx Page from Page Library

24

Click OK

This will create a new Search Vertical on the Search Center with name My Documents.

25

26

Finally we need to test this new Search Vertical.

Currently I am logged in as sp\spdeveloper

Go to Search Center

Enter Search Query in our case which is *.pdf to return all the documents with the extension .pdf.

Everything Search Vertical will show all the PDF documents returned by the query

27

But My Document Search Vertical will show only those PDF documents which are Authored or Co-Authored by me

28

29

Creating new Search Verticals can be helpful in the scenarios where business user needs to filter out the results returned by the queries under different names by limiting the results based on the Result Sources.

Hope this will help someone in need.

Advertisements

4 thoughts on “SharePoint 2013: How To Create Custom Search Verticals

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