1. Redirecting the Search Box to the Search Center
After the search center has been deployed, it
will be possible to make searches from the center's search page, modify
preferences, and perform advanced searches from the Advanced Search
page. However, the main search box that appears on all pages will still
point to OSSSearchResults.aspx
. So you'll need to direct
these queries to the search center you have created. For multiple site
collections that share a single search center, redirecting this search
box to the shared search center can be extremely useful.
To modify the target of the search box, follow these steps and refer to Figure 1.
- Navigate to the top level of the site collections.
- Choose Site Actions, Site Settings.
- Under Site Collection Administration, choose Search Settings.
- In the Site Collection Search Result page field, define your new
search results page. If you named your Basic Search Center “Search”,
this path will be
/Search/results.aspx
. If you created an Enterprise Search Center and named it “Search”, the path will be /Search/Pages/results.aspx
.
Figure 1. Changing the search box target
These are the basic steps necessary for
deploying a search center to SharePoint 2010. Using one of the built-in
search centers is the quickest way to get a feature-rich, customizable
search user interface. However, as previously mentioned, search does
work out of the box and many organizations can get by using the default OSSSearchResults.aspx
results page. For others, even the search centers are not enough or
perhaps not flexible enough. This will require them to create their own
Web Part pages and deploy the search Web Parts individually to them—or
perhaps deploy them to other site pages or even create their own Web
Parts .
2. Web Part Deployment
It is possible to deploy search on your
SharePoint 2010 installation without actually deploying a search center.
Both search and result Web Parts can be added to normal pages without
using the built-in templates. The method of deploying the search Web
Parts is the same as deploying any other Web Part on SharePoint 2010. In
fact, all the functionality of the Basic and Enterprise Search Centers
can be recreated by building a site with the search Web Parts. However,
this is a lengthy task, and most if not all of the search functionality
necessary for most organizations is available on the search centers.
Therefore, unless extremely custom search usage is required, it is
recommended to use the built-in templates and deploy a search center.
Adding Web Parts
To add Web Parts to an existing page, do the following:
- Choose Edit Page under Site Actions while logged in as a site administrator.
- Select Editing Tools and Insert.
- Click Web Part.
- Choose the Search category and the search Web Part you want to add (Figure 2).
- Save and close the editor under the page menu in the ribbon.
Figure 2. Adding search Web Parts
After the Web Parts are added to the page, the
target of the search box can be added by editing the Web Part or
customizations to the parts made. In Figure 3, a search box and core results Web Part have been added to the home page of the default SharePoint site.
Figure 3. A crude example of adding search Web Parts to a page
A better example of when to add the search Web
Parts to a non-search page would be for displaying a diverse set of
documents or pages in a single list regardless of their location in
SharePoint. This could be a list of the latest ten documents that have a
given term in them or documents by a specific author. Using the result
Web Part alone on a Web Part page and setting a fixed query for that Web
Part can allow this information to be displayed anywhere on the site
that the administrator deems useful.