In this post you’ll learn:
Using a search vertical in an everyday situation
You might not have heard the term “search vertical” before, but I’m pretty sure you’ve used them several times. So let me show you what we mean by the term "search vertical."
I like to ski, so I often search for ski-related content. When I enter the word “ski” in a search engine, I get a wide variety of search results.
I am glad to see that there is much information out there on the topic of skiing, but many times I am just looking for great ski-pictures. And this is where search verticals come into play.
On the same search results page, I just click IMAGES, and in an instant my screen is filled with images of people in colorful clothing, racing down white slopes while bathing in sunshine from a clear blue sky.
When I click on IMAGES, I am using a search vertical. Bing has five search verticals: WEB, IMAGES, VIDEOS, MAPS and NEWS.
A search vertical filters search results so that only a certain type of search results are displayed. When I clicked on the IMAGES search vertical, the search results were filtered so that only images were displayed.
About search verticals in SharePoint 2013
In SharePoint 2013, search verticals are displayed in the Search Navigation Web Part. There are four default search verticals: Everything, People, Conversations and Videos.
When users click on one of these search verticals, they are in fact navigating to a new page. For example, the default search results page, the Everything search vertical, uses the results.aspx page.
When users click on the People search vertical, they are in fact navigating to the peopleresults.aspx page.
These are the default pages that are used for the four search verticals:
To view these pages, from the Site settings menu, select Site contents --> Pages.
The default vertical pages all use these Web Parts:
The difference between these pages is how the Search Results Web Part is configured. To be specific: the Web Parts are configured to use different result sources.
Result sources - why setting limits is a good thing
As I explained in an earlier blog post, a result source specifies the source from where your search results can come from. For example, imagine that your search index is the cube in the image below, where you have four result sources:
So, by limiting from where search results can come from, you can make it easier for your users to find what they’re looking for.
In my internal search center scenario, all search results are list items that represent a type of media file, for example an article, an image or a video. I wanted to create three custom search verticals for three specific types of media files:
This is how I defined the Art result source.
Remember, {searchTerms?} (contentclass:sts_listitem) path:http://<path> was the query text of the Article result source that I created earlier. To this, I added AND ContentType:Art
In our lists, we use the site column Content Type to specify the different media files. For example, all images have the value Art for Content Type.
So, by adding AND ContentType:Art to the query text, only list items that have the value Art for Content Type will be returned in search results.
Here are the three new result sources I created.
Now that I had three new result sources, I could move on to creating the custom search verticals.
How to create a custom search vertical
When you create a custom search vertical, the first thing you have to do is to create a page that the search vertical will use. To create a new page, here’s what you should do:
Now that you have a page for your custom search vertical, you can start to create the actual search vertical. Here’s what you should do:
In my scenario, I entered united airlines again, and noticed that only 11 search results were displayed. Remember, before I changed the result source in the Search Result Web Part, 13 results were displayed. So my new vertical was working. Nice!
In my scenario, I added two more search verticals, Video and Interop. And with that, I had completed the Search Center set up.
- Using a search vertical in an everyday situation
- About search verticals in SharePoint 2013
- Result sources – why setting limits is a good thing
- How to create a custom search vertical
- What you can do after you have successfully set up a Search Center
Using a search vertical in an everyday situation
You might not have heard the term “search vertical” before, but I’m pretty sure you’ve used them several times. So let me show you what we mean by the term "search vertical."
I like to ski, so I often search for ski-related content. When I enter the word “ski” in a search engine, I get a wide variety of search results.
I am glad to see that there is much information out there on the topic of skiing, but many times I am just looking for great ski-pictures. And this is where search verticals come into play.
On the same search results page, I just click IMAGES, and in an instant my screen is filled with images of people in colorful clothing, racing down white slopes while bathing in sunshine from a clear blue sky.
When I click on IMAGES, I am using a search vertical. Bing has five search verticals: WEB, IMAGES, VIDEOS, MAPS and NEWS.
A search vertical filters search results so that only a certain type of search results are displayed. When I clicked on the IMAGES search vertical, the search results were filtered so that only images were displayed.
About search verticals in SharePoint 2013
In SharePoint 2013, search verticals are displayed in the Search Navigation Web Part. There are four default search verticals: Everything, People, Conversations and Videos.
When users click on one of these search verticals, they are in fact navigating to a new page. For example, the default search results page, the Everything search vertical, uses the results.aspx page.
When users click on the People search vertical, they are in fact navigating to the peopleresults.aspx page.
These are the default pages that are used for the four search verticals:
Search vertical | Use this page |
Everything | results |
People | peopleresults |
Conversations | conversationresults |
Videos | videoresults |
The default vertical pages all use these Web Parts:
- Refinement Web Part
- Search Box Web Part
- Search Navigation Web Part
- Search Results Web Part
The difference between these pages is how the Search Results Web Part is configured. To be specific: the Web Parts are configured to use different result sources.
Result sources - why setting limits is a good thing
As I explained in an earlier blog post, a result source specifies the source from where your search results can come from. For example, imagine that your search index is the cube in the image below, where you have four result sources:
- Result source 1: search results can come from the entire cube.
- Result source 2: search results can come only from the Bs.
- Result source 3: search results can come only from the Cs.
- Result source 4: search results can come only from the Ds.
So, by limiting from where search results can come from, you can make it easier for your users to find what they’re looking for.
In my internal search center scenario, all search results are list items that represent a type of media file, for example an article, an image or a video. I wanted to create three custom search verticals for three specific types of media files:
- Art: list items that represent images
- Video: list items that represent videos
- Interop: items that represent interop articles (interop articles are a specific type of articles that we produce)
This is how I defined the Art result source.
Remember, {searchTerms?} (contentclass:sts_listitem) path:http://<path> was the query text of the Article result source that I created earlier. To this, I added AND ContentType:Art
In our lists, we use the site column Content Type to specify the different media files. For example, all images have the value Art for Content Type.
So, by adding AND ContentType:Art to the query text, only list items that have the value Art for Content Type will be returned in search results.
Here are the three new result sources I created.
Now that I had three new result sources, I could move on to creating the custom search verticals.
How to create a custom search vertical
When you create a custom search vertical, the first thing you have to do is to create a page that the search vertical will use. To create a new page, here’s what you should do:
- From the Site Settings menu, select Site contents.
- Select Pages.
- In the Pages library, select the FILES tab --> New Document --> Page.
- On the Create Page page, enter a Title and a URL Name.
In my scenario, I entered Art and art.
- Click Create.
Now that you have a page for your custom search vertical, you can start to create the actual search vertical. Here’s what you should do:
- On the Site Settings page, click Search Settings.
- On the Search Settings page, in the Configure Search Navigation section, click Add Link.
- In the Navigation Link dialog box, in the Title field, enter the search vertical title. This text will appear as the “tab” name on your search results page.
In my scenario, I entered Art.
- In the URL field, select Browse and select a page for your search vertical.
In my scenario, I selected the art page I just created.
- Click OK to close the Navigation Link dialog Box.
- On the Search Settings page, in the Configure Search Navigation section, select the search verticals that you don’t want to display, and click Delete.
In my scenario, I deleted the People, Conversations and Videos verticals, so that I was only left with the Everything and the Art search vertical.
- Click OK to save all changes.
- In your Search Center, enter a query. On your search results page, your newly created search vertical is displayed.
On my search results page, the Art vertical was displayed.
- On your search results page, click on your newly created search
vertical, and verify that the URL is the same as you specified in step
4.
In my scenario, I clicked Art, and verified that the URL was <site>/articles/Pages/art.aspx. I also noticed that 13 search results were displayed.
- On your new search vertical page, select to edit the page, and then to edit the Search Results Web Part.
- In the Web Part tool page, click Change query. This will open a dialog box.
- In the Build Your Query dialog box, from the Select a query menu, select the result source that you created for this search vertical (what we did in the previous section).
In my scenario, I selected Art result source (Site Collection).
- Click OK and save the page.
In my scenario, I entered united airlines again, and noticed that only 11 search results were displayed. Remember, before I changed the result source in the Search Result Web Part, 13 results were displayed. So my new vertical was working. Nice!
In my scenario, I added two more search verticals, Video and Interop. And with that, I had completed the Search Center set up.
No comments:
Post a Comment