- About the Search Center example in this series
- How to copy a default item display template
- How to create a result type
Category | Definition |
TechNet content | Articles that have been published on the TechNet platform |
MSDN content | Articles that have been published on the MSDN platform |
Office.com content | Articles that have been published on the office.com platform |
Images content | Images that are used in publications |
Video content | Videos that are used in publications |
Download content | Downloadable content |
- Copy a default item display template.
- Rename your newly created item display template.
- Open the new display template and change the
tag. Remember, the text in this tag is what will be shown when you do configurations in the SharePoint UI.
In my scenario, I changed the
- Save the new item display template.
Now that we have created a new item display template, we can move on to creating a new result type.
Depending on your permission level, you create a result type on two levels:
Permission level | Where the result type will be added |
Site collection administrator | To all sites within a site collection |
Site collection owner | To a single site |
To save space, I will only show you how to create a result type as a Site collection administrator.
- Go to Site settings --> Search Result Types.
Instead of creating a new result type from scratch, you could make your life a bit easier by copying an existing result type and modifying it to fit your new result type. If you do this, ensure that you copy a result type that closely resembles the new result type you want to create.
- On the Manage Result Types page, from the result type menu field, select Copy.
In my scenario, I wanted to customize search results for SharePoint list items, so I copied the SharePoint List Item result type.
- On the Add Result Type page, here's what you need to do:
- In the Give it a name field, enter a name for your new result type.
In my scenario, I entered TechNet content. - From the Which source should results match menu, select the result source that you have used to configure the query in your Search Result Web Part.
- In the What types of content should match? You can skip this rule to match all content menu, all the default result type are listed.
In my scenario, I chose Select a value. - Click Show more conditions.
This opens up a menu where you can specify the result type based on managed property values.
In my scenario, all list items contain a site column called Distribution Channel. As I showed you at the beginning of this blog, this site column contains the publication platform value, for example TechNet Library. I wanted to use values from this site column to specify which list items should belong to my new result type
- From the Which custom properties should match menu, I selectedDistributionChannelOWSCHCS. DistributionChannelOWSCHCS is the managed property that represents the Distribution Channel site column. In the fields below, I entered all the values that should specify the new TechNet content result type.
- From the What should these results look like menu, select the display template that should be used by this result type.
In my scenario, I selected my newly created TechNet content display template.
- Click Save.
Your newly created result type is now listed on the Managed Result Types page.
In my scenario, I could see that the TechNet content result type had been created.
So now that we have a new result type, the next step is to modify the display template that is associated with this result type. There are different ways you can go about doing this, so in the next two blog posts, I'll explain two different options.
No comments:
Post a Comment