You are creating a Microsoft Office SharePoint Server 2007 web part. You write the following code segment:
01: Public cmdCrawler as Button
02: Protected Overloads OverRides Sub CreateChildControl()
03: cmdCrawler = New Button AS Crawler cmdCrawler.Click, AddressOf CommandCrawl_Click
04: cmdCrawler.Text = “Index”
05: Controls.Add(cmdCrawler)
06: End Sub
07:
08: Public Sub cmdCrawler_Click(ByVal sender AS object, ByVal e as eventArgs)
09: Dim xspContent as Microsoft.Office.Server.Search.Administration.Content = New 12
10: Microsoft.Office.Server.Search.Administration.Content
(SearchContent.Current)
11: …
12: End Sub
You need to ensure that the web part initiates a search crawl of a content source named Patents. Which code segment should you insert?
A.
Dim spContentSources as ContentSourceCollection = xspContent.ContentSources
B.
Dim cs AS ContentSource = xspContent.Sources(“Patents”)
cs.StartFullCrawl
C.
Dim xspContentSources as ContentSourceCollection=xspContent.ContentSources Dim TargetScope as URI = New URI(“http://myPortal/SearchCenter/Search.aspx?scope=Patents”) xspContentSources=UpdateTargetScope
D.
Dim xspContentSources as ContentSourceCollection=xspContent.ContentSources Dim CrawlMappings as CrawlMappingCollection=xspContentSources.Parent.CrawlMapping Dim ResultsPagesURI as URI = New URI(me.Context.ToString)
Dim TargetScope as URI = New URI(“http://myPortal/SearchCenter/Search.aspx?scope=Patents”) CrawlMappings.Create(ResultsPage, TargetScope)
Dim sspContentSources as ContentSourceCollection = sspContent.ContentSources Dim sspContentSource = sspContentSources(“Patents”)
csUpdateNow