Tuesday, April 27, 2010

SharePoint 2007 Search Enhancements

Until now i've always configured Search for SharePoint for Publishing websites, simply just by enabling Search. I did notice the search results weren´t of very good quality, but it sufficed.

The client of a recent project i´m working on, is much more critical and thus the search should provide good and clean results. To be able to achieve this, i've implemented the SearchEnhancements Solution.

The first and hardest one to get resolved was that the indexer also indexed terms like `Site Actions` and `Publishing`. These terms are of the SharePoint Web UserInterface and obviously you don´t want to display this to anonymous users as search results. The solution is to define a set of exclusion crawl rules in the SSP which indexes your Publishing website. The Solution has a WebApplication Feature which creates the crawl rules in the associated SSP.

Another problem i´ve noticed with search was that unwanted parts of content were getting indexed. For instance the menus were getting indexed, and also some deep-link components. The problem with this is that you might get these unwanted parts to be displayed as summary-text for a searchresult. Also when searching for a specific term which is also present in a deep-link component, all pages would be returned as search results. For this i've implemented a solution which i've found on the internet, a customcontrol which cloacks the content for the Moss indexer.

The third minor problem was that ASP.NET would not recognize the Moss indexer as a crawler. This is because the standard UserAgent string of SharePoint does not include the "Crawler" term. For this i've created a Farm Feature which modifies the UserAgent string in the registry. The WFE's probably have to be restarted to effectuate the registry modifications.

The solution is available here at CodePlex.