Home | Blog | Screencasts | Projects
# Saturday, February 20, 2010

If you’ve ever built a custom protocol handler for MOSS before you may have in the past used the object model to create the content source, since there is no way in Central Admin to do this.

 

Something like:

 

SearchContext context = SearchContext.GetCurrent(spSite);

Content content = new Content(context);

CustomContentSource source = (CustomContentSource)content.ContentSources.Create( ...
source.Update();

But the SearchContext in SharePoint 2010 is marked as obsolete, which makes total sense when you consider that the SSP is no more, it’s been replaced by service applications.

 

The good news is that we can use Powershell to create the custom content source:

 

> $sapp = Get-SPEnterpriseSearchServiceApplication –Identity “Search Service Application”

>New-SPEnterpriseSearchCrawlContentSource –SearchApplication $sapp –Name “Custom Source Name” –Type Custom –StartAddress  protocol://servername –CrawlPriority Normal –MaxPageEnumerationDepth 1 –MaxSiteEnumerationDepth 1

 

 

So much easier …

 

Also when you register your custom protocol handler for SharePoint 2010, remember that the registry hive location now has the number ‘14.0’ in its path:

 

HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Office  Server/14.0/Search/Setup/ProtocolHandlers

 

I still need to have a good play the new BCS stuff in SharePoint 2010, but looking at this post by Todd Baginski I have a feeling that we might have a few more tricks up our sleeves before we go down the custom protocol handler or FAST pipeline route.

Saturday, February 20, 2010 9:36:00 AM (E. Australia Standard Time, UTC+10:00)  #    Comments [1] - Trackback
Search | SharePoint 2010
Tracked by:
"Best Cordless Drill" (Best Cordless Drill) [Trackback]
Statistics
Total Posts: 191
This Year: 4
This Month: 0
This Week: 0
Comments: 41