文章編號: 937884 - 上次校閱: 2007年6月6日 - 版次: 1.1

如何在 SharePoint Server 2007 中的索引 SharePoint 入口網站 Server 2003 清單項目

系統提示本文適用於您使用的作業系統之外的作業系統。與您不相關的文章內容已停用。
全部展開 | 全部摺疊

簡介

本文將告訴您,如何進行索引在 Microsoft Office SharePoint Server 2007 Microsoft Office SharePoint 入口網站伺服器 2003年清單項目。

預設情況下,SharePoint Server 2007 不具有選項以索引 SharePoint 入口網站 Server 2003 清單項目。索引中 SharePoint Server 2007 SharePoint 入口網站 Server 2003 清單項目、 新增內容來源,然後建立指向該伺服器的編目規則所執行的 SharePoint 入口網站 Server 2003。然後,使用 SharePoint Server 2007 物件模型,將編目規則的 [ContentClass 屬性設定為 0 (零) 的值。

其他相關資訊

如果要 SharePoint 入口網站 Server 2003 清單項目在 SharePoint Server 2007 中的索引請依照下列步驟執行。

Microsoft 僅,為了說明提供程式設計範例,不提供任何明示或默示的保證。這包括,但不限於適售性或適合某特定用途之默示擔保責任。本文假設您已熟悉使用我們所示範的程式設計語言以及建立和偵錯程序所使用的工具。Microsoft 技術支援工程師可以協助解釋特定程序的功能。不過,不會修改這些範例以提供附加功能或建構程序,以符合您特定需求。
  1. 啟動 SharePoint 3.0 管理中心。
  2. 建立指向執行的 SharePoint 入口網站 Server 2003 的伺服器的內容來源。要這麼做,請您執行下列步驟:
    1. 應用程式管理,然後按一下 [建立或設定此陣列共用的服務OfficeSharePoint 伺服器的共用服務
    2. 按一下 [共用服務提供者 (SSP) 您想要設定。
    3. 在首頁] 頁面按一下 [在 [搜尋] 下的 [搜尋設定]。
    4. 在進行搜尋設定] 頁面按一下 [搜尋設定] 下的 [內容來源和耙梳排程]。
    5. 在 [管理內容來源] 頁面中,按一下 [新增內容來源]。
    6. 加入內容來源] 頁面上指定的內容來源設定,再按 [確定]

      備忘稿
      • 請確定您指定執行 SharePoint 入口網站 Server 2003 的伺服器。
      • 使用預設設定來在頁面上其他的選項。
      • 預設情況下,耙梳設定使用 編目為每個起始位址的主機名稱] 下的所有項目] 選項。如果您設定耙梳設定,以使用 編目只 SharePoint 網站的每個起始位址 選項,SharePoint Server 2007 不耙梳 SharePoint 入口網站 Server 2003 清單項目。編目只 SharePoint 網站的每個起始地址] 選項會覆寫 ContentClass 屬性設定,就會發生這個問題。
  3. 建立指向執行的 SharePoint 入口網站 Server 2003 的伺服器的編目規則。 要這麼做,請您執行下列步驟:
    1. 按一下 [共用服務管理,] 然後按一下 [共用服務提供者 (SSP)。
    2. 在首頁] 頁面按一下 [在 [搜尋] 下的 [搜尋設定]。
    3. 在 「 設定搜尋設定 」 頁面上按一下 [編目設定,] 下的 [編目規則,然後按一下 [新增的編目規則
    4. 在 [加入搜尋規則] 頁面上指定耙梳規則的設定。當您指定的設定時,請確定您執行下列:
      • 指定在 [路徑] 方塊中執行 SharePoint 入口網站 Server 2003 的伺服器路徑。
      • 按一下以選取 編目複雜 URL (包含問號 (?) 的 URL)] 核取方塊。
  4. 建立 Microsoft Windows 架構應用程式會將耙梳規則的 ContentClass 屬性設定為 0 (零) 的值。下列是此範例程式碼。 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 != "" && CrawlPathText.Text != "")
                {
                    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 = "0";
                            rule.Update();
                            MessageBox.Show("ContentClass was set to: " + rule.ContentClass.ToString());
                        }
                        else
                        {
                            MessageBox.Show("There was a problem. Make sure the Crawl path is correct.");
                            CrawlPathText.Focus();
                        }
    
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message.ToString());
                        SSPPath.Focus();
                    }
                }
                else
                {
                    MessageBox.Show("Need to enter a SharedServices Path as well as the name to a Crawl Path");
                    SSPPath.Focus();
                }
            }
        }
    }
    
    附註 如果您編譯並再執行該應用程式,執行下列動作:
    • 設定 SSPPath 方塊為 http://ShareServices_ HostName:Port
    • CrawlPathText 方塊設為您在步驟 3 中建立編目規則指定的路徑。比方說設定路徑為 http:// PortalSiteName / *。

?考

更多有關 SharePoint Server 2007 物件模型的資訊,請參閱 Microsoft Office SharePoint Server 2007 軟體開發套件 (SDK)。若要欲 SharePoint Server 2007 SDK 請造訪下列 Microsoft 網站]:
http://msdn2.microsoft.com/en-us/library/ms550992.aspx (http://msdn2.microsoft.com/en-us/library/ms550992.aspx)
或要下載 SharePoint Server 2007 SDK,請造訪下列 Microsoft 網站:
http://www.microsoft.com/downloads/details.aspx?familyid=6d94e307-67d9-41ac-b2d6-0074d6286fa9&displaylang=en (http://www.microsoft.com/downloads/details.aspx?familyid=6d94e307-67d9-41ac-b2d6-0074d6286fa9&displaylang=en)

這篇文章中的資訊適用於:
  • Microsoft Office SharePoint Server 2007
  • Microsoft Office SharePoint Portal Server 2003
關鍵字:?
kbmt kbinfo kbhowto kbexpertiseinter KB937884 KbMtzh
機器翻譯機器翻譯
重要:本文是以 Microsoft 機器翻譯軟體翻譯而成,而非使用人工翻譯而成。Microsoft 同時提供使用者人工翻譯及機器翻譯兩個版本的文章,讓使用者可以依其使用語言使用知識庫中的所有文章。但是,機器翻譯的文章可能不盡完美。這些文章中也可能出現拼字、語意或文法上的錯誤,就像外國人在使用本國語言時可能發生的錯誤。Microsoft 不為內容的翻譯錯誤或客戶對該內容的使用所產生的任何錯誤或損害負責。Microsoft也同時將不斷地就機器翻譯軟體進行更新。
按一下這裡查看此文章的英文版本:937884? (http://support.microsoft.com/kb/937884/en-us/ )
Microsoft及(或)其供應商不就任何在本伺服器上發表的文字資料及其相關圖表資訊的恰當性作任何承諾。所有文字資料及其相關圖表均以「現狀」供應,不負任何擔保責任。Microsoft及(或)其供應商謹此聲明,不負任何對與此資訊有關之擔保責任,包括關於適售性、適用於某一特定用途、權利或不侵權的明示或默示擔保責任。Microsoft及(或)其供應商無論如何不對因或與使用本伺服器上資訊或與資訊的實行有關而引起的契約、過失或其他侵權行為之訴訟中的特別的、間接的、衍生性的損害或任何因使用而喪失所導致的之損害、資料或利潤負任何責任。