Customize Search Tabs
You use tabs to group search queries and
results by scope. By keeping each scope in its
own tab, you can also create a different search
form for each scope. Users access a custom
search form to query by fields or values that
apply only to a particular scope, and the
results displayed pertain only to that scope.
By default, the Search Center contains
two tabs, All Sites and People. These tabs
appear on the Search Center home page. The
All Sites tab searches all SharePoint content
sites; the scope for People is limited to My
Sites. If you want to add a new custom tab,
follow these steps:
On the Search Center home page, click
Site Actions, Edit Page to reveal the Web parts
that form this search page.
Click Add New Tab.
Enter a tab name (e.g., Catalog) and
page (e.g., catalog.aspx), then click OK.
Click Site Actions, Create Page.
Create a new .aspx page with the name
you used in step 3 using the (Welcome Page)
Advanced Search page layout template, then
click Create.
In the Middle Upper Left Zone (or a
different zone if you prefer), click Add a Web
Part.
In the Add Web Parts dialog box, select
Advanced Search Box, then click Add.
You’ve added a new search tab named Catalog
to your Search Center, and it includes the
Advanced Search Web part.
Customize Advanced
Search
Earlier, we created a custom scope that you
could access from anywhere in the site to
search for contents only within the Catalog
document library. Now, imagine this library has a custom column
named Color Category.
We want users to be able
to search for documents
in this library that are
tagged with a particular
color. With the standard
search box, if the user
searches for a color (e.g.,
green), the results include
all documents that have
the word green anywhere
in the document body or
metadata. But what if the
user wanted to search
only those documents
that are tagged as green
in the Color Category
field? The Advanced Search Web part, with
some customizations, can help answer that
question. Here’s how:
Go to the catalog.aspx page in Search
Center, then click Site Actions, Edit Page.
In the Advanced Search Web part, click
edit, Modify Shared Web Part.
The Advanced Search Web part tool
pane appears on the right. This pane lets you
customize most of the search behavior and
text labels. The tool pane contains the following
categories: Search box. This category lets you show
or hide text boxes for specific searches, such
as “All words,” “none of these words,” and
so forth. You can also change the label that
appears with these text boxes. Scopes. Here you can specify whether you
want the scope selector shown to the user.
When shown, the scope selector appears as a
check box list so that the user can select more
than one scope for a search. You can also
specify which scope grouping to show in this
list. Scope groups are defined on the Site Settings
page under Site Collection Administration.
The default groups available are Search
Dropdown and Advanced Search. The Show
the result type picker option lets users specify
search result item types, such as Microsoft
Word, Microsoft Excel, PDF, or HTML files;
this option must be checked to enable the
properties search. Properties. This is where you can enable
searches by custom fields. The Properties
text box contains an XML code snippet that
dictates how the properties are displayed in
the search form. Miscellaneous. This section lets you specify the results display page. By default,
results are displayed in results.aspx, but you
can create your own customized results page
and enter its location here.
Expand the Properties category in
the tool pane to update the XML snippet
to include the custom Color Category field.
Click the ellipsis next to the text box to view
the XML code.
Locate the <PropertyDefs> node and
add the following code anywhere in it:
Locate the <ResultTypes> node with
the DisplayName="All Results" attribute and
add the following anywhere in it:
<PropertyRef Name=”ColorCategory” />
Click OK to save changes.
As Figure 3 shows, when you refresh
the search page, you’ll see a new value named
Color Category for property restrictions.
Manage Metadata
Property Mappings
Note that in step 5 above, we referred to a
property definition with the name ColorCategory.
SharePoint doesn’t yet know how to
search for this property. You need to define
this property such that it maps to the field
named Color Category in the Catalog document
library. This definition is done through
metadata property mapping.
SharePoint list and document library
fields are also referred to as properties. As the SharePoint search engine crawls through
lists, it indexes the properties, which are
then referred to as crawled properties. You
define relationships between list properties
and crawled properties through Search Setting’s
Metadata Property Mappings. For the
example above, you can define a new managed
property named ColorCategory and
map it to the crawled property that points
to the document library’s field named Color
Category by following these steps:
Navigate to the Shared Services Administration
home page and click Search settings.
In the Crawl Settings section, click
Metadata property mappings.
Click New Managed Property in the
toolbar.
Enter ColorCategory for Property
name.
Make sure Text is selected under The
type of information in this property.
In the Mappings to crawled properties section, click Add Mapping.
In the Crawled property selection dialog
box, select the property labeled ows_Color_
x0020_Category(Text), then click OK. Note
that all custom fields in lists and document
libraries are prefixed with ows_ in the
crawled properties index. Spaces in field
names are translated to _x0020_.
Click OK to save the property.
You’ve now created a property definition
that maps to the Color Category field. After a
full crawl of the site, you can start using this
property definition in the advanced search
page to get targeted results.
What's next for virtualization and business IT? Windows IT Pro senior editor Jeff James speaks with VMware President and CEO Diane Greene on the future of virtualization technology. ...
An often irreverent look at some of the week's other news, including the long-awaited back to school season, Microsoft's first Seinfeld/Gates ad, some EU insights, another Netbook improvement, Opera silliness, and much, much more ...
IT Connections Dive into the new Microsoft platforms and products you implement and support with the experts from Microsoft, TechNet Magazine, Windows ITPro and industry gurus. There are 70+ sessions and interactive panels with networking opportunities.
Attention User Group Leaders... Announcing the eNews Generator—a FREE HTML e-newsletter builder for user group leaders. Build your HTML and text e-newsletters in minutes and add Windows IT Pro & SQL Server Mag articles alongside your own message!.
Master SharePoint with 3 eLearning Seminars Learn how to build a better SharePoint infrastructure and enable powerful collaboration with MVPs Dan Holme and Michael Noel. Register today!
Get SQL Server 2008 at WinConnections Don’t miss Microsoft Exchange and Windows Connections conferences, the premier events for Microsoft IT Professionals in Las Vegas, November 10-13. Every attendee will receive a copy of SQL Server 2008 Standard Edition with one CAL.
Order Your SQL Fundamentals CD Today! Learn how to use SQL Server, understand Office integration techniques and dive into the essentials of SQL Express and Visual Basic with this free SQL Fundamentals CD.
blarg1234 July 02, 2008 (Article Rating: