Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


April 2008

Customize Search Features in Microsoft Office SharePoint Server 2007

MOSS gives site admins the tools to target searches to users' needs
RSS
Subscribe to Windows IT Pro | See More Administration Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Customize Search Results
By default, the Search Center displays results in the results.aspx page. You can customize this page or create your own results page. For example, consider the document library with the custom Color Category field. When a user searches against the Catalog scope, you want the search results page to display a field named Color Category. You can achieve this by modifying the XSL markup of the Search Core Results Web part in the search results page.

Start by performing a search with the Catalog scope so that you get a results page where only items that fall within the Catalog scope are displayed. After you have such a page, follow these steps to create a new search results page:

  1. Click Site Actions, Create Page.
  2. Enter a Title (e.g., Catalog Results) and a URL Name (e.g., catalogresults.aspx) for the new page.
  3. Select the (Welcome Page) Search Results Page layout, then click Create.

    After step 3, you’ll see the catalogresults.aspx page in edit mode, which shows its various Web parts. Search Core Results is the Web part that displays the search results. You need to modify this Web part to include the Color Category column in the search results view. In the Search Core Results Web part, click edit, Modify Shared Web Part. This action displays the Web part properties tool pane. As Figure 4 shows, the tool pane contains the following categories:
    Results Display/Views—In this section, you specify search results to display per page, sentences to show in the results display, and so forth.
    Results Query Options—This section lets you specify options such as duplicate results removal, search term stemming, and noise word inclusion. Word stemming matches a search word with its grammatical variants; for example, the word crawl stems to crawls, crawled, crawler, and so forth. Noise words, also known as stop words, are words that aren’t significant indicators for content, such as the word the.
    Fixed Keyword Query—This section lets you enter a specific keyword to automatically include with every search
    Miscellaneous—Here you can narrow the scope of search results, and also choose options such as Show Action Links, Display “Alert Me” Link, Display “RSS” Link, and so forth.
    Below these categories, you’ll find the Data View Properties section, which contains the XSL markup that controls the HTML to render the search results dataset. So, to continue the process of customizing the results page:
  4. Expand the Results Query Options category.
  5. Add the following line of XML to the Columns node in the Selected Columns text box, then click OK:
     <Column Name=”ColorCategory”/>
    Remember that we’ve already defined the ColorCategory column. The SharePoint search engine returns data internally in XML format. This XML data is transformed to an HTML view through XSL markup.
  6. Under the Data View Properties section, click XSL Editor to display the Text Entry dialog box with the XSL markup that renders the XML results into HTML.
  7. Copy the XSL markup to an external text editor, such as Microsoft Office Share- Point Designer 2007. SharePoint Designer is a WYSIWYG editor, so it helps you visualize the results of the XSL code as you edit.
  8. Locate the result template node in the markup; its first line looks like this:
     <xsl:template match=”Result”>  
  9. Add the following before the line
     Color Category: <xsl:value-of
      select=”colorcategory” />
    Note that the value colorcategory is written in all lower case, regardless of how it was written in metadata property mapping.
  10. Copy and paste the entire XSL markup back into the Text Entry dialog box, then click Save.
  11. Click OK to save changes to the XSL markup and the Web part.

Now when you perform a search using the search box, you’ll see the Color Category property exposed in the search results area. By following these steps, you can expose any property that’s already stored in the metadata

Control SharePoint Searches
You should now have a good idea of how you can customize the search experience in MOSS 2007. The procedures shown in this article, though simple, can easily be leveraged to create more meaningful business solutions that can crawl and index a large amount of disparate data, yet offer end users targeted search capabilities to zero in on a specific subset of data. Custom search scope definitions also let administrators schedule indexing and crawling of each scope separately: Only scopes with frequently changing contents need to be crawled frequently. This ability not only saves server resources, but it also makes the search results more accurate and fresh.

End of Article

   Previous  1  2  [3]  Next  


Reader Comments
efsaefee

blarg1234 July 02, 2008 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Friday at PASS Europe 2006

Kevin talks about the closing day of the event and shares a funny Microsoft film. ...

Escape From Yesterworld

Kevin points you to the funniest SQL Server website ever! ...

PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...


Related Articles Stsadm: Taking Control of SharePoint Administration

High Availability for MOSS 2007 Server Farms

SharePoint Server 2007 Unleashed

SharePoint Security Evolution

SharePoint Whitepapers Best practices for deploying Microsoft Office SharePoint Server 2007

Protecting Sharepoint with Double-Take for Windows 5.0

Dramatically Accelerate Microsoft SharePoint

Related Events Introduction to Identity Lifecycle Manager "2"

Delivering Reliable and Effective Web-Based Applications

Making Web Application Perform Better: What to Watch, How to Watch It, and How to Fix It

Check out our list of Free Email Newsletters!

SharePoint eBooks Getting Started with SharePoint

Keeping Your Business Safe from Attack: Monitoring and Managing Your Network Security

Related IIS and Web Administration Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing