Other than the tab control,
the basic three search pages are essentially the same in the Basic,
Enterprise, and FAST Search Center sites. The customization of the pages
involves the placement and customization of Web Parts.
Search results Web Parts in SharePoint 2010 are based
on the Federation Object Model (FOM) and are used by both SharePoint
Search and FAST Search. The Web Parts on a results page communicate with
a shared query manager identified in the Web Parts as the Cross Web
Part Query ID. This query manager receives the query passed to the page,
gathers the requirements and query modifications from the results Web
Parts, processes the query, and returns the results to the appropriate
Web Parts. For new Web Parts to participate with existing Web Parts, the
new Web Parts simply need to use the same query ID. Because the
out-of-the-box Web Parts are no longer sealed, developers can extend
their functionality instead of writing new ones from scratch.
1. Query Pages
The Welcome page of all Search Center sites is a
basic query page named Default.aspx. Although this page seems rather
simple, as shown in Figure 1, it supports a number of customization options.
The page has two Web Part zones but only a single Search
Box Web Part. You can choose to add other Web Parts, such as a content
editor where instructions on how to search more effectively can be
presented. Because Web Parts can be targeted by audience, you may add
multiple instances of the same Search Box Web Part on the same page
customized for different groups of users.
The Preferences link next to the Search
Box allows you to apply the new “conversational” approach introduced in
SharePoint 2010 Search; it opens the dialog box shown in Figure 2, where users can configure personal preferences for the configuration of the Web Part.
The user’s first option regards the display of search
suggestions as they type in query terms. These suggestions are
retrieved from the history of successful queries. Users can also choose
to override the default behavior of searching in the language of the
browser and instead choose up to five languages to include in the search
results. From that list, they can choose the default language, which is
given a higher relevance ranking in the results list.
2. Search Box Web Part
The Search Box Web Part is used in both search and
results pages and has the same functionality as the Search Box control
on the master pages. To configure the properties of a Web Part on the
Search page, perform the following steps.
From the Site Actions menu or the Page Ribbon of the page, select Edit Page.
In the Web Part zone, click the small down arrow for the Web Part to expose the context menu and then select Edit Web Part.
Expand the appropriate sections to configure properties as needed.
For
publishing pages, you need to save, check in, and publish the page
after making changes. For standard pages, the action is simply Stop
Editing.
The Scopes Dropdown section of the Search Box Web Part is shown in Figure 3. The Dropdown mode options are the same as those of the Site Settings Search Settings page. The choices are as follow.
Do Not Show Scopes Dropdown, And Default To Target Results Page
Does not display a scope drop-down list and sends the query to the
results page with no scope selected. Normally, this will be a custom
results page with Web Parts configured to use one or more scopes.
Show Scopes Dropdown Displays the scopes defined in the search drop-down display group and the contextual scopes in the scopes list.
Show, And Default To ‘S’ URL Parameter
Displays the scopes defined in the search drop-down display group and
the contextual scopes in the scopes list. The selected scope will be
added to the query passed to the results page using the ‘s’ parameter.
Show, And Default To Contextual Scope
Displays the search drop-down list and automatically selects the This
Site or This List scope as the default. Contextual scopes cannot be
managed in the search drop-down list.
Show, Do Not Include Contextual Scopes Displays only the scopes in the search drop-down list that do not include This Site and This List contextual scopes.
Show, Do Not Include Contextual Scopes, And Default To ‘S’ URL Parameter
Displays only the scopes defined in the search drop-down display group
in the scopes list. The selected scope will be added to the query passed
to the results page using the ‘s’ parameter.
Normally, you do not need to enter text in the
Dropdown Label box or modify the default automatic Fixed Dropdown Width
setting (0).
The Query Text Box Label and Query Text Box Label Width text boxes are shown in Figure 4.
Additional query terms can be added to the user-entered query; the
Additional Query Description Label text box is usually empty. The text
entered in this text box shown in Figure 13-21
limits the results to contracts. Any keyword query can be placed here,
including scope definitions. Because these terms modify the query
transparently to the user, appropriately labeling the query box will
inform the user of its functionality. The prompt string will appear in
the query box unless the focus is set there automatically or unless
thecursor is placed there manually. The Append Additional Terms To Query
check box is critical because the additional query terms entered in
this section are not used unless it is selected.
The search query box, shown in Figure 5, displays the configurations set in Figure 4.
The Query Suggestions section, shown in Figure 6,
controls the suggestions process, where the preferences page let users
opt in or out. The Minimum Prefix Length setting determines how many
characters a user must enter before suggestions are offered. The
Suggestion Delay setting controls the response time, and the Number Of
Suggestions To Display setting controls the maximum number of
suggestions.
The Miscellaneous section shown in Figure 7 is probably the most often used in customizing search. The first four entries control the Search button images.
Two switches, Use Site Level Defaults and Use Site
Dropdown Mode, override the settings in the Scope Dropdown section. Use
these options to establish centralized control of multiple search box
Web Parts from the Search Settings of the site collection.
Below this, two switches control the advanced search
and user preferences links at the end of the query box. You might choose
not to offer an advanced search page for some searches, such as the
People Query page in the Enterprise Search Center. Obviously, if you did
not select the Show Query Suggestions check box in the previous
section, you also might choose to remove the user preferences link.
Remember that user preferences also control query languages.
In the Advanced Search Page URL box, you can direct
the advanced search link to the appropriate custom page. This text box
is active even if the Display Advanced Search Link check box is not
selected. The URL entered will be a relative path for local pages.
The Target Search Results Page URL setting configures
the target page for queries. Because the actual work of the search
query is accomplished by the results page, you might configure custom
query pages or custom query Web Parts where the only customization is
the target results page.
The Display Submitted Search check box affects only Search
Box Web Parts placed on a results page. By displaying the original
query, these Web Parts permit the user to easily modify the query
without retyping it. If you need to change the scope display group, you
must type the name exactly as it appears in the site collection scope
management page.
The Appearance, Layout, and
Advanced sections are standard for SharePoint Web Parts. If you need to
target to audiences, you can find the Audiences configuration in the
Advanced section. By having multiple Search Box Web Parts targeted to
different audiences on the same page, you can have a single query page
customized to the user opening it.