How to custom search results in SharePoint Server 2013

SharePoint Server 2013 and SharePoint Online comes with many default search features that help users find what they’re searching for. But you might want your search results to look a certain way, for example, display information that’s specific to your company or business.

In this blog series, I’ll explain how you can customize the way search results are displayed. To help explain, I’ll use examples from a tool that I use on a daily basis: an internal list of Microsoft publications. 

As you know, Microsoft publishes thousands of articles across TechNet, MSDN and office.com. To assist in the publishing process, we use several SharePoint lists. Each item in a list represents an article or a media file. To quickly find information about a list item, we’ve set up a Search Center that searches across all of the lists.
Throughout this series, I’ll show you how I’ve changed the way search results are displayed from this��?/P>

Default search result

... to this:

Customized search result

In this series, we’ll cover:

 


How search works in a few words


In case you’re not so familiar with how search works, here’s a high level representation that might be useful for this series.

Search overview

  1. Content is stored in lists and libraries. Site columns are used to store values, or in other words information, about each item in a list or library.
  2. When lists and libraries are crawled, site columns and the site column values are added to the search index. 
  3. In the search index, site columns are “transformed��?into managed properties. Site column values are “transformed��?into managed property values
  4. On a search page, a user enters a query in a Search Box Web Part. The query is sent to the search index.
  5. Search results are sent from the search index to a search results page, and displayed in a Search Results Web Part.  The Search Results Web Part uses display templates that specify which managed property values should be displayed.

 

Here’s how to understand this high level representation in the context of Microsoft’s internal Search Center. 

  1. A Microsoft writer creates a list item for an article she'll be writing. Site columns, such asTitle, Content Summary and Technical Subject, are used to store values, or in other words, information, about the article.

List item

  1. The list has been marked for continuous crawl. This means that that the list will be crawled at a set interval, for example, every minute.

    You can see the crawl schedule in List Settings --> Catalog Setting.

Crawl schedule

  1. From Site Settings --> Search Schema you can search for managed properties.

    In my scenario, there’s a managed property named ContentSummaryOWSMTXT, and another one namedowstaxIdTechnicalSubject. They represent the site columns Content Summary andTechnical Subject (for more details about the “transformation��?of site columns into managed properties, see the blog postFrom site column to managed property - What's up with that?).

Two managed properties

  1. On a search page, a user enters a query, for example customize search results.

Entered query

  1. On a search results page, search results are displayed in a Search Results Web Part. The Web Part uses display templates that specify that the values from the managed propertiesContentSummaryOWSMTXT and owstaxIdTechnicalSubject should be displayed in the search results (the display templates specify many other things as well, but for now, let’s just concentrate on the values of these two managed properties). The second search result is the list item created in step 1. We can see that the values from the managed propertiesContentSummaryOWSMTXT and owstaxIdTechnicalSubject are are displayed in the search result.

Search result

You can also see details such as a small icon next to each search result on the page. These icons represent the site to which the article is published, such as Office.com and TechNet . The search result also contains the words "Technical Subject" in front of the value search. I’ll show you how I added the icons and the words in later blog posts. But first, I'll tell you more about how search results are displayed.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值