Building public-facing websites using SharePoint 2007: search functionality

This is a third post of the blog post series on building public-facing websites using SharePoint 2007. The first part was dedicated to the planning building public-facing websites using SharePoint 2007. The second part was dedicated to custom branding and development in SharePoint.

Plan SharePoint search: performance and sizing

Here is an excellent post on planning performance and sizing for SharePoint search:

Customize search box

To customize search box in SharePoint:

  • Search for PlaceHolderSearchArea in the code
  • Change Visible property of PlaceHolderSearchArea section to False: visible="false"
  • Add Search Box web part
  • To hide search scope drop down, add <DropDownModeEx xmlns="urn:schemas-microsoft-com:SearchBoxEx">HideScopeDD</DropDownModeEx> tag to the Search Box web part section of the code. More options for Search Scope Drop Down can be found at
  • To hide Advanced Search option, add <Property Name="ShowAdvancedSearch">false</Property> tag to the Search Box web part section of the code
  • To change images for search buttons, modify GoImageUrl, GoImageUrlRTL, GoImageActiveUrl, GoImageActiveUrlRTL tags
  • There are a lot more things you can customize in the Search Box, just read through the tags within PlaceHolderSearchArea section

There is also another way to customize search box by modifying SearchArea.xml under C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\OSearchEnhancedFeature. This is a much less elegant way, but it works.

Clean up your SharePoint search results.

To remove noisy search results that users do not want and/or do not have permissions to see:

  • Open your Shared Services Provider
  • Click on Search Settings >> Crawl Rules
  • Add crawl rules to exclude the following paths:
    • *://*webfldr.aspx*
    • *://*my-sub.aspx*
    • *://*mod-view.aspx*
    • *://*allitems.aspx*
    • *://*all forms.aspx*
    • *://*/lists/*
    • *://*DispForm.aspx*

Permissions issues with search

I have already blogged about some permissions issues with SharePoint search and anonymous users. Basically it has to do with the page layout inheriting certain classes that are not accessible to the anonymous users, but you can read the rest in my previous blog post:

Block search engines from crawling non-public parts of the website

Activate ViewFormsPagesLockDown feature. This is a MOSS-only feature that disallows anonymous access to pages in the _layouts directory that inherit from LayoutsPageBase and disallows anonymous access any of the form or view pages (DispForm.aspx, AllItems.aspx). Otherwise, search engines will be able to view/crawl the parts of SharePoint you don't want them to see.

Best bets/Keyword feature

Use best bets feature in SharePoint search. Even though the interface is a bit awkward, I find this feature quite useful. Here are the instructions on how to manage best bets/keywords:

Performance optimization

Here are the best practices for search in SharePoint:

The next topic of this blog post series will be dedicated to implementing or preserving SEO practices in SharePoint…

Related resources: