Which code segment should you insert at line 13?

You are creating a Microsoft Office SharePoint Server 2007 Web Part.

You write the following code segment. (Line numbers are included for reference only.)

01 public Button cmdCrawl;
02 protected override void CreateChildControls()
03 {
04 cmdCrawl = new Button();
05 cmdCrawl.Click += new EventHandler(cmdCrawl_Click);
06 cmdCrawl.Text = “Update Index”;
07 }

08 public void cmdCrawl_Click(object sender, EventArgs e)
09 {
10 Microsoft.Office.Server.Search.Administration.Content sspContent =
11 new Microsoft.Office.Server.Search.Administration.Content
12 (SearchContext.Current);
13 …

14 }

You need to ensure that the Web Part initiates a search crawl of a scope named Patents.

Which code segment should you insert at line 13?

You are creating a Microsoft Office SharePoint Server 2007 Web Part.

You write the following code segment. (Line numbers are included for reference only.)

01 public Button cmdCrawl;
02 protected override void CreateChildControls()
03 {
04 cmdCrawl = new Button();
05 cmdCrawl.Click += new EventHandler(cmdCrawl_Click);
06 cmdCrawl.Text = “Update Index”;
07 }

08 public void cmdCrawl_Click(object sender, EventArgs e)
09 {
10 Microsoft.Office.Server.Search.Administration.Content sspContent =
11 new Microsoft.Office.Server.Search.Administration.Content
12 (SearchContext.Current);
13 …

14 }

You need to ensure that the Web Part initiates a search crawl of a scope named Patents.

Which code segment should you insert at line 13?

A.
ContentSourceCollection sspContentSources =
sspContent.ContentSources;
ContentSource cs = sspContentSources[“Patents”];
cs.StartFullCrawl();

B.
ContentSourceCollection sspContentSources =
sspContent.ContentSources;
Uri TargetScope = new
Uri(“http: //myportal/SearchCenter/Search.aspx?Scope=Patents”);
sspContentSources.Update(TargetScope);

C.
ContentSourceCollection sspContentSources =
sspContent.ContentSources;
CrawlMappingCollection crawlmappings =
sspContentSources.Parent.CrawlMappings;
Uri ResultsPage = new Uri(this.Context.ToString());
Uri TargetScope = new
Uri(“http: //myportal/SearchCenter/Search.aspx?Scope=Patents”);
crawlmappings.Create(ResultsPage, TargetScope);

D.
ContentSourceCollection sspContentSources =
sspContent.ContentSources;
ContentSource cs = sspContentSources[“Patents”];
cs.Update();



Leave a Reply 0

Your email address will not be published. Required fields are marked *