Leveraging and Optimizing Search in SharePoint 2010 : Customizing the Search User Interface

2/16/2011 9:19:23 AM
At a certain point, many organizations will want to consider customizing the default search experience to make it better match their specific needs. This can involve the creation of custom search centers or customizing search scopes, among other things.

Creating Search Centers

Search centers are the web pages that provide for the search user interface most often used in SharePoint. They can be created in an easy way, and they provide a full query and result displaying capabilities.

There are three types of search centers in SharePoint 2010:

  • A Basic Search Center is a simple site for delivering search functionality. It includes pages for search results and advanced search.

  • An Enterprise Search Center is a more complex site with more pages and a better user experience. Its pages are organized into tabs that can be easily accessed by the users. By default, there are two tabs on the welcome page: one for the general search results and one for the people results. Site administrators can add more pages and tabs, regarding to the current search requirements. There is also a way to create different pages and tabs for the different scopes so that they can be defined as a Target URL for the searches of each scope.

  • A FAST Search Center is the search site providing the rich FAST Search experience. The site’s content is similar to the Enterprise Search Center but with richer capabilities that take advantage of FAST Search Server for SharePoint 2010.

If you want to create a site for any type of search center, perform the following steps:

Go to the site where you want to create the search center. Open the Site Actions menu, and select New Site.

Filter the site templates for search on the left navigation bar.

Select the type of the search center you want to deploy: Basic, Enterprise, or FAST Search Center.

Type the Title and URL of the search center on the right side.

Click More Options if you want to set the Description of the new search center, or configure the permissions or navigation inheritance.

After selecting the necessary settings, click Create, and the new search center will be ready to use immediately.

Assign Search Pages to the Scopes

Whatever type of search center you deploy, you can create more than one search results page. If you have Enterprise or FAST Search Centers, these pages can be displayed on tabs on the top of all result pages so that the navigation can be easy as well.

The steps for creating a new page and displaying it as a tab are as follows:

Open the Site Actions menu and choose the New Page action.

Type the name of your page; for example, Documents.

Click Create, and the page will be created immediately in the Pages library.

The page can be edited as any other page in SharePoint 2010.

On the top of any result page of this search center, there are multiple tabs. In Edit mode, there are also two options for managing the tabs: Add New Tab and Edit Tabs.

Click Add New Tab, and type a tab name and the page name just created (for example, documents.aspx). Typing a tooltip is optional but can be useful to provide detailed information about the results page to the end users.

To display the same tab on the Welcome Page of the search center, repeat steps 5 and 6 on the Welcome Page as well.

Click Save, and the tab is ready to be used.

Of course, these search results pages also can be customized. For example, you can filter the results for a specified scope:

Open the Site Actions menu on your search results page, and choose Edit Page.

Locate the Search Core Results web part on the page, and edit it.

Expand the group Location Properties of the web part settings. Here you can find the field Location, where you can select the list of Federated Locations if you want to use one of them.

You can also find here the Scope field, where you can type the name of your scope to be used on this search results page (for example, Documents), as shown in Figure 1.

Figure 1. Assign a scope to the search results page.

Save the web part settings; then save and close the page. Now, your page is filtered by the selected scope.

To assign this page (documents.aspx) to a specified scope (Documents), go to central administration and open the admin page of your search service application. Then follow these steps to finish the configuration of scopes and pages:

Open the Scopes list from the group Queries and Results on the left navigation bar.

Select the scope you want to modify, open its context menu, and choose Edit Properties and Rules action.

On the next page, select Change Scope Settings.

Here you can find the field Target Results Page. Select the radio button Specify a Different Page for Searching This Scope and type the URL of the page you’ve configured for this scope (for example, https://home.companyabc.com/ootb_search/Pages/documents.aspx).

Click OK and your changes will be saved.

Creating Custom Search Pages

In SharePoint 2010, there is also the possibility to create custom search pages anywhere around the SharePoint farm. These pages can be the part of each search center or any other site type.

Basically, the Search function includes two user interactions: the Search Box for typing queries in and the results that are displayed. Both of them can be placed either on the same page or on different ones, depending on the requirements. In this way, you can build your own interfaces for the search functions. For example, you can insert a Search Box and a Core Results web part to a document center for searching the items in the Documents Scope; or insert a People Search Box to your HR site.

To create a new search page, perform the following steps:

Create a new web part page on your site.

Edit the page, and insert a Search Box web part.

If you want to display the results on the same page, insert a Core Results web part as well; otherwise, open the page that will display the results, and insert the Core Results web part to that.

Edit the Search Box properties:

  • Scopes drop-down you can configure if the Scopes drop-down should be displayed and where to default it.

  • Query Text Box format and additional query terms.

  • Query Suggestions are only shown if the check box Show Query Suggestions is checked. Configure the minimum length of the query prefix, the suggestion delay, and the number of suggestions to display.

  • In the Miscellaneous group, there are the options to change the button images, and set the Advanced Search Page URL and the Target Search Results Page URL. Type the page URL you want to use that contains the Search Core Results Web Part.

  • Scope Display Groups can be defined at the site collection level. By default, there are two groups: one for the Search drop-down and one for the Advanced Search. Feel free to create your own group and associate the proper scopes to it, as shown in Figure 2.

    Figure 2. Creating new Scope Display Groups.

  • In the settings of the Search Box web part, type the name of the Scope Display Group that you want to use instead of the default one.

  • Set the general properties of the Search Box web part.

  • Save your changes.

Insert the Search Core Results web part to the page you want to use for displaying the results.

Edit the properties of the Search Core Results web part:

  • Location Properties contain the settings for using Federated Location or to specify a scope available from this site.

  • Display Properties define the default sorting criteria, number of results per page, characters in summary and URL, and so on.

  • Results Query Options, such as Query Language, Fixed Keyword Query, and Append Text to Query.

  • You also can configure the More Results link appearance and URL.

Save your page.

Customize the Refinement Panel

The Refinement Panel, shown in Figure 3, is part of the search results page of search centers by default, but because it is a web part, it can be added to any results page in your SharePoint 2010 site. Moreover, a Refinement Panel can also be customized to your needs; it is a useful and powerful tool for filtering the result set.

Figure 3. Viewing the out-of-the-box Refinement Panel.

To customize the Refinement Panel, perform the following steps:

Open the search results page for editing.

Open the context menu of the Refinement Panel, and choose the action Edit Web Part.

Expand the setting group Refinement, and open the Filter Category Definition field, as shown in Figure 4, by clicking on the small button labeled ‘...’.

Figure 4. Viewing a Filter Category Definition of the Refinement Panel.

To edit this XML description, it is useful to open an XML editor and copy the XML code there directly.

You can find the filter field descriptions in the CustomFilters tag. For example, you can find CustomFilter tags for Email, Excel, Image, PowerPoint, Visio, Webpage, Word, and so on.

To add new values to a custom filter, you have to add new OriginalValue tags for each value. For example, the custom filter “PowerPoint” does not contain the extensions pps and ppsx. To add them, insert new OriginalValue tags, as shown in the following code snippet:

<CustomFilter CustomValue="PowerPoint">

You can also add new filter fields, by adding new CustomFilter tags to the CustomFilters in the Result Type category.

In addition, it is possible to remove any of the filters by deleting its CustomFilter tag from the XML Description.

After finishing all modifications desired, copy the XML back to the Refinement Panel web part’s editor, click OK, and save the changes.

  •  Leveraging and Optimizing Search in SharePoint 2010 : Keywords and Best Bets
  •  Leveraging and Optimizing Search in SharePoint 2010 : Federating Search
  •  Leveraging and Optimizing Search in SharePoint 2010 : Search Scopes
  •  Active Directory Domain Services 2008 : View Cached Credentials on a Read-Only Domain Controller
  •  Active Directory Domain Services 2008 : Remove a User, Group, or Computer from the Password Replication Policy
  •  Active Directory Domain Services 2008 : Add a User, Group, or Computer to the Password Replication Policy
  •  Exchange Server 2010 : Backing Up Specific Windows Services
  •  Create Bookmark Create Note or Tag Backing Up Windows Server 2008 and Exchange Server 2010
  •  What to Back Up on Exchange Servers 2010
  •  Leveraging and Optimizing Search in SharePoint 2010 : Define Content Sources
  •  Deploying a Native SharePoint 2010 Search Service Application
  •  Backing Up the Exchange Server 2010 Environment : Roles and Responsibilities & Developing a Backup Strategy
  •  Backing Up the Exchange Server 2010 Environment : Supporting Backups with Documentation
  •  Backing Up the Exchange Server 2010 Environment : Understanding the Importance of Backups & Establishing Service Level Agreements
  •  Making the Best Use of SAN/NAS Disks with Exchange Server 2010
  •  Optimizing an Exchange Server 2010 Environment - Properly Sizing Exchange Server 2010
  •  Optimizing an Exchange Server 2010 Environment - Analyzing and Monitoring Core Elements
  •  SharePoint 2010 : Beyond Built-In SharePoint PowerShell Cmdlets
  •  SharePoint 2010 : Understanding Advanced PowerShell Topics
  •  Optimizing an Exchange Server 2010 Environment : Monitoring Exchange Server 2010
    Top 10
    Building Out Of Browser Silverlight Applications - Controlling the Application Window
    Exchange Server 2010 : Maintaining Reliability and Availability - Recover Data
    jQuery 1.3 : Table Manipulation - Sorting and paging (part 1) : Server-side sorting & JavaScript sorting
    jQuery 1.3 : Developing plugins - Adding new global functions
    SQL Server 2008 : Programming Objects - Implementing Stored Procedures
    Windows Azure : Messaging with the queue - Decoupling your system with messaging
    Tools to Manage Access Control Lists
    Mobile Application Security : The Apple iPhone - Local Data Storage: Files, Permissions, and Encryption
    Design and Deploy High Availability for Exchange 2007 : Create Bookmark Create Note or Tag Implement Standby Continuous Replication (SCR)
    Deploying the Client for Microsoft Exchange Server 2010 : Pushing Outlook Client Software with Group Policies
    Most View
    ASP.NET 4 in VB 2010 : The Security Controls
    iPhone 3D Programming : Adding Textures to ModelViewer (part 4) - Enabling Textures with ES2::RenderingEngine
    Outlining AD DS Changes in Windows Server 2008 R2 (part 3) - Auditing Changes Made to AD Objects
    SharePoint 2010 : SQL Server Database Mirroring for SharePoint Farms
    Building LOB Applications : Data Validation through Data Annotation
    Navigating Architecture Changes in Windows Vista
    iPhone 3D Programming : Adding Depth and Realism - Shaders Demystified
    jQuery 1.3 : Modifying table appearance (part 2) - Tooltips
    Design and Deploy High Availability for Exchange 2007 : Design Edge Transport and Unified Messaging High Availability
    Personalizing Windows 7 (part 3) - Choosing and Configuring Your Screensaver
    SQL Server 2008 : Service Broker - Message Types
    Designing and Implementing Mobility in Exchange Server 2010 : Securing Access to ActiveSync Using Internet Security and Acceleration (ISA) Server 2006
    SQL Server 2008 : What Is the Base Class Library?
    Creating and Managing Views in SQL Server 2008 : Creating Views
    Examining Integration Points Between SharePoint and Public Key Infrastructure
    jQuery 1.3 : Modifying table appearance (part 3) - Collapsing and expanding sections
    Advanced ASP.NET : Creating a Component
    Installing SharePoint 2010 Using PowerShell
    iPhone 3D Programming : Holodeck Sample (part 4) - Replacing Buttons with Orientation Sensors
    iPhone 3D Programming : Reflections with Cube Maps