Microsoft KB Archive/937884

= How to index SharePoint Portal Server 2003 list items in SharePoint Server 2007 =

Article ID: 937884

Article Last Modified on 6/6/2007

-

APPLIES TO


 * Microsoft Office SharePoint Server 2007
 * Microsoft Office SharePoint Portal Server 2003

-



INTRODUCTION
This article describes how to index Microsoft Office SharePoint Portal Server 2003 list items in Microsoft Office SharePoint Server 2007.

By default, SharePoint Server 2007 does not have an option to index SharePoint Portal Server 2003 list items. To index SharePoint Portal Server 2003 list items in SharePoint Server 2007, add a content source, and then create a crawl rule that points to the server that is running SharePoint Portal Server 2003. Then, use the SharePoint Server 2007 object model to set the ContentClass property of the crawl rule to a value of 0 (zero).



MORE INFORMATION
To index SharePoint Portal Server 2003 list items in SharePoint Server 2007, follow these steps.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.  Start SharePoint 3.0 Central Administration. Create a content source that points to the server that is running SharePoint Portal Server 2003. To do this, follow these steps:  Click Application Management, and then click Create or configure this farm's shared services under OfficeSharePoint Server Shared Services. Click the Shared Service Provider (SSP) that you want to configure. On the Home page, click Search settings under Search. On the Configure Search Settings page, click Content sources and crawl schedules under Crawl Settings. On the Manage Content Sources page, click New Content Source.</li> On the Add Content Source page, specify the settings for the content source, and then click OK.

Notes <ul> Make sure that you specify the server that is running SharePoint Portal Server 2003.</li> Use the default settings for the other options on the page.</li> By default, the crawl settings use the Crawl everything under the hostname for each start address option. If you set the crawl settings to use the Crawl only the SharePoint Site of each start address option, SharePoint Server 2007 will not crawl SharePoint Portal Server 2003 list items. This behavior occurs because the Crawl only the SharePoint Site of each start address option overrides the ContentClass property setting.</li></ul> </li></ol> </li> Create a crawl rule that points to the server that is running SharePoint Portal Server 2003. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> Click Shared Services Administration, and then click the Shared Service Provider (SSP).</li> On the Home page, click Search settings under Search.</li> On the Configure Search Settings page, click Crawl rules under Crawl Settings, and then click New Crawl Rule.</li> On the Add Crawl Rule page, specify the settings for the crawl rule. When you specify the settings, make sure that you do the following: <ul> Specify the path of the server that is running SharePoint Portal Server 2003 in the Path box.</li> Click to select the Crawl complex URLs (URLs that contain a question mark (?)) check box.</li></ul> </li></ol> </li>  Create a Microsoft Windows-based application that sets the ContentClass property of the crawl rule to a value of 0 (zero). The following is sample code that does this. This sample code creates a Windows form that contains a text box that is named SSPPath, a crawl rule text box that is named CrawlPathText, and a button that is named button1. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Microsoft.Office.Server.Search.Administration; using Microsoft.SharePoint; using Microsoft.SharePoint.Portal; using System.Web; using Microsoft.Office.Server;

namespace WindowsApplication1 {   public partial class Form1 : Form {       public Form1 {           InitializeComponent; }

private void button1_Click(object sender, EventArgs e)       { if (SSPPath.Text != &quot;&quot; && CrawlPathText.Text != &quot;&quot;) {               try {                   SPSite site = new SPSite(SSPPath.Text);

SearchContext.GetContext(site); Content content = new Content(SearchContext.GetContext(site));

CrawlRule rule = content.CrawlRules.Test(CrawlPathText.Text);

if (rule != null) {                       rule.ContentClass = &quot;0&quot;; rule.Update; MessageBox.Show(&quot;ContentClass was set to: &quot; + rule.ContentClass.ToString); }                   else {                       MessageBox.Show(&quot;There was a problem. Make sure the Crawl path is correct.&quot;); CrawlPathText.Focus; }

}               catch (Exception ex) {                   MessageBox.Show(ex.Message.ToString); SSPPath.Focus; }           }            else {               MessageBox.Show(&quot;Need to enter a SharedServices Path as well as the name to a Crawl Path&quot;); SSPPath.Focus; }       }    } }  Note When you compile and then run the application, do the following: <ul> Set the SSPPath box to http://ShareServices_ </li> Set the CrawlPathText box to the path that you specified for the crawl rule that you created in step 3. For example, set the path to http:// /*.</li></ul> </li></ol>

<div class="references_section">