One of the biggest and most popular features in SharePoint 2010 is search capability. Clearly there has been a lot of investment in a search area and architecture of search has been completely redesigned since MOSS.
In this article I want to show you how you can perform custom result set trimming but before we do that – let’s take a look at SharePoint 2010 search service architecture.
Above, the Gatherer is a is responsible for crawling the content from all of the Repositories which in turn loads all of the protocol handlers and filters that will read search terms from various content.
Next important component of the SharePoint search is query processing pipeline, which is a set of components that accepting the search query from the user (using a webpart) and taking on that query to a search service application and issuing a search. Once the results are returned and out-of-the-box security trimming has completed – query processing pipeline allows for custom trimmers to kick in a do their work. When custom trimmers are done – the result set is returned back to the web front end server that issues the search.
It’s important to know that custom trimmer can only work on a subset of existing results and can not return more results than the ones stripped out by out of the box security trimmer.
Essentially to deploy your own security trimmer do the following:
- Implement ISecurityTrimmer2 interface (as an assembly) by implementing required methods.
- Deploy the trimmer assembly into the GAC of all the machines where a search query service is running.
- On a Search Administration site create a crawl rule for the content sources that you want to custom trim.
- Register custom trimmer for the crawl rule.
- Initiate a full crawl of the content sources associated with the crawl rules that you created before.
In my next article we’ll check out how you can build custom trimmer assembly and create appropriate crawl rule.
… stay tuned.
