管理 SharePoint Server 中的編目規則Manage crawl rules in SharePoint Server

摘要:了解如何指定內容存取帳戶、 建立編目規則以包含或排除目錄,以及設定編目規則。Summary: Learn how to specify a content access account, create crawl rules to include or exclude directories, and prioritize crawl rules.

在編目內容時,您可新增編目規則以包括或排除特定路徑。當您包括某路徑時,您可提供替代帳戶認證以編目該路徑。除了建立或編輯編目規則外,您還可測試、刪除或錄製現有編目規則。You can add a crawl rule to include or exclude specific paths when you crawl content. When you include a path, you can provide alternative account credentials to crawl it. In addition to creating or editing crawl rules, you can test, delete, or reorder existing crawl rules.

使用編目規則執行下列作業:Use crawl rules to do the following:

  • 避免在網站上的內容進行編目。例如,如果您建立內容來源以編目http://www.contoso.com,但您不希望搜尋系統編目的內容從子目錄http://www.contoso.com/downloads、 建立編目規則以排除內容不該子目錄。Prevent content on a site from being crawled. For example, if you created a content source to crawl http://www.contoso.com, but you do not want the search system to crawl content from the subdirectory http://www.contoso.com/downloads, create a crawl rule to exclude content from that subdirectory.

  • 會否則排除在網站上編目的內容。例如,如果您排除內容從http://www.contoso.com/downloads從所編目,但又想要子目錄中的內容http://www.contoso.com/downloads/content要編目建立編目規則以包含該子目錄的內容。Crawl content on a site that would be excluded otherwise. For example, if you excluded content from http://www.contoso.com/downloads from being crawled, but you want content in the subdirectory http://www.contoso.com/downloads/content to be crawled, create a crawl rule to include content from that subdirectory.

  • 指定驗證認證。若要編目的網站需要不同的認證以外的預設內容存取帳戶,建立編目規則以指定的驗證認證。Specify authentication credentials. If a site to be crawled requires different credentials than those of the default content access account, create a crawl rule to specify the authentication credentials.

您可以使用星號 () 萬用字元字元的編目規則。例如,若要排除 JPEG 檔案從編目上http://www.contoso.com、 建立編目規則以排除http://www.contoso.com/ *.jpgYou can use the asterisk () as a wildcard character in crawl rules. For example, to exclude JPEG files from crawls on http://www.contoso.com, create a crawl rule to exclude http://www.contoso.com/*.jpg.

編目規則的順序很重要,因為與一組特定的內容相匹配的第一個規則將會被套用。The order of crawl rules is important, because the first rule that matches a particular set of content is the one that is applied.

建立或編輯編目規則To create or edit a crawl rule

  1. 確認執行此程序的使用者帳戶是否為 Search Service 應用程式的管理員。Verify that the user account that is performing this procedure is an administrator for the Search service application.

  2. 在管理中心的 [應用程式管理] 區段中,按一下 [管理服務應用程式]。In Central Administration, in the Application Management section, click Manage Service Applications.

  3. 在 [管理服務應用程式] 頁面上,按一下服務應用程式清單中的 [Search Service 應用程式]。On the Manage Service Applications page, in the list of service applications, click the Search service application.

  4. 在 [搜尋管理] 頁面上的 [正在編目] 區段中按一下 [編目規則。管理編目規則] 頁面隨即顯示。On the Search Administration page, in the Crawling section, click Crawl Rules. The Manage Crawl Rules page appears.

  5. 若要建立新的編目規則,請按一下 [新增編目規則。若要編輯現有的編目規則、 編目規則的清單中指向您想要編輯、 按一下出現箭號,然後按一下 [編輯編目規則的名稱。To create a new crawl rule, click New Crawl Rule. To edit an existing crawl rule, in the list of crawl rules, point to the name of the crawl rule that you want to edit, click the arrow that appears, and then click Edit.

  6. 在 [新增編目規則] 頁面的 [路徑] 區段中:On the Add Crawl Rule page, in the Path section:

    • 在 [路徑] 方塊中輸入的路徑將對其套用編目規則。您可以使用標準的萬用字元路徑中。In the Path box, type the path to which the crawl rule will apply. You can use standard wildcard characters in the path.

    • 若要使用規則運算式代替萬用字元,選取 [使用比對此規則的規則運算式語法To use regular expressions instead of wildcard characters, select Use regular expression syntax for matching this rule.

  7. 在 [編目設定] 區段中選取下列選項之一:In the Crawl Configuration section, select one of the following options:

    • 排除此路徑中的所有項目。如果您想要從編目中排除指定的路徑中所有項目,選取此選項。如果您選取這個選項,您可以藉由選取要排除包含使用問號 (?) 表示法的參數的 Url 中排除複雜的 Url (包含問號 (?))縮小排除。Exclude all items in this path. Select this option if you want to exclude all items in the specified path from crawls. If you select this option, you can refine the exclusion by selecting Exclude complex URLs (URLs that contain question marks (?)) to exclude URLs that contain parameters that use the question mark (?) notation.

    • 包含此路徑中的所有項目。如果您想要編目的路徑中所有項目,選取此選項。如果您選取這個選項,可進一步調整內含選取這些選項的任意組合:Include all items in this path. Select this option if you want all items in the path to be crawled. If you select this option, you can further refine the inclusion by selecting any combination of these options:

      請遵循在不編目 URL 本身 URL 的連結。如果您想要編目的 URL,但不是起始 URL 本身內所含的連結選取此選項。Follow links on the URL without crawling the URL itself. Select this option if you want to crawl links contained within the URL, but not the starting URL itself.

      編目複雜的 Url (包含問號 (?))。如果您想要編目內含參數使用問號 (?) 表示法的 Url,請選取此選項。Crawl complex URLs (URLs that contain a question mark (?)). Select this option if you want to crawl URLs that contain parameters that use the question mark (?) notation.

      編目 SharePoint Server 內容為 http 頁面]。一般而言,SharePoint Server 網站進行編目所使用的特殊的通訊協定。如果您想要改為 HTTP 頁面編目的 SharePoint Server 網站,選取此選項。當使用 HTTP 通訊協定來編目內容時,未儲存項目權限。Crawl SharePoint Server content as http pages. Normally, SharePoint Server sites are crawled by using a special protocol. Select this option if you want SharePoint Server sites to be crawled as HTTP pages instead. When the content is crawled by using the HTTP protocol, item permissions are not stored.

  8. 在 [指定驗證] 區段中,執行下列動作之一:In the Specify Authentication section, perform one of the following actions:

    注意

    除非在 [編目設定] 區段中選取 [包含此路徑中的所有項目] 選項不提供此選項。This option is not available unless the Include all items in this path option is selected in the Crawl Configuration section.

    • 若要使用預設內容存取帳戶,請選取 [使用預設內容存取帳戶]。To use the default content access account, select Use the default content access account.

    • 如果您想要使用不同的帳戶,選取 [指定不同的內容存取帳戶] ,然後在 [帳戶] 方塊中輸入可存取這個編目規則中所定義之路徑的使用者帳戶名稱。接下來,在 [密碼] 和 [確認密碼] 方塊中,輸入此使用者帳戶的密碼。若要避免使用基本驗證,選取 [不允許基本驗證] 核取方塊。伺服器會嘗試使用 NTLM 驗證。如果 NTLM 驗證失敗時,伺服器會嘗試使用基本驗證除非已選取不允許基本驗證] 核取方塊。If you want to use a different account, select Specify a different content access account and then in the Account box, type the user account name that can access the paths that are defined in this crawl rule. Next, in the Password and Confirm Password boxes, type the password for this user account. To prevent basic authentication from being used, select the Do not allow Basic Authentication check box. The server attempts to use NTLM authentication. If NTLM authentication fails, the server attempts to use basic authentication unless the Do not allow Basic Authentication check box is selected.

    • 若要使用的用戶端憑證進行驗證,請選取 [指定用戶端憑證、 展開 [憑證] 功能表,然後選取憑證。To use a client certificate for authentication, select Specify client certificate, expand the Certificate menu, and then select a certificate.

    • 若要使用表單認證進行驗證,請選取 [指定表單認證、 在 [表單 URL ] 方塊中輸入表單 URL (接受認證資訊] 頁面的位置) 和 [輸入認證。從遠端伺服器的登入提示開啟時在新視窗中,輸入您要登入的表單認證。系統提示您如果登入成功。如果登入成功,所需的驗證認證會儲存在遠端網站。To use form credentials for authentication, select Specify form credentials, type the form URL (the location of the page that accepts credentials information) in the Form URL box, and then click Enter Credentials. When the logon prompt from the remote server opens in a new window, type the form credentials with which you want to log on. You are prompted if the logon was successful. If the logon was successful, the credentials that are required for authentication are stored on the remote site.

    • 若要使用 cookie,請選取 [使用 cookie 以進行編目],然後選取 [從 URL 取得 cookie從網站或伺服器取得 cookie。或者,選取 [從您的本機檔案系統或檔案共用匯入 cookie指定編目的 cookie。您可以選擇在 [錯誤頁面 (以分號分隔) ] 方塊中指定錯誤頁面。To use cookies, select Use cookie for crawling, and then select Obtain cookie from a URL to obtain a cookie from a website or server. Or, select Specify cookie for crawlingto import a cookie from your local file system or a file share. You can optionally specify error pages in the Error pages (semi-colon delimited) box.

    • 若要允許匿名存取,請選取 [匿名存取To allow anonymous access, select Anonymous access.

  9. 按一下 [ OK ]。Click OK.

在 URL 上測試編目規則To test a crawl rule on a URL

  1. 確認執行此程序的使用者帳戶是否為 Search Service 應用程式的管理員。Verify that the user account that is performing this procedure is an administrator for the Search service application.

  2. 在管理中心的 [應用程式管理] 區段中,按一下 [管理服務應用程式]。In Central Administration, in the Application Management section, click Manage Service Applications.

  3. 在 [管理服務應用程式] 頁面上,按一下服務應用程式清單中的 [Search Service 應用程式]。On the Manage Service Applications page, in the list of service applications, click the Search service application.

  4. 在 [搜尋管理] 頁面上的 [正在編目] 區段中按一下 [編目規則On the Search Administration page, in the Crawling section, click Crawl Rules.

  5. 在 [管理編目規則] 頁面中輸入 URL 並按一下測試以了解是否它符合規則] 方塊中,輸入您想要測試的 URL。On the Manage Crawl Rules page, in the Type a URL and click test to find out if it matches a rule box, type the URL that you want to test.

  6. 按一下 [測試]。測試的結果會顯示下方輸入 URL 並按一下測試以了解是否它符合規則] 方塊中。Click Test. The result of the test appears below the Type a URL and click test to find out if it matches a rule box.

刪除編目規則To delete a crawl rule

  1. 確認執行此程序的使用者帳戶是否為 Search Service 應用程式的管理員。Verify that the user account that is performing this procedure is an administrator for the Search service application.

  2. 在管理中心的 [應用程式管理] 區段中,按一下 [管理服務應用程式]。In Central Administration, in the Application Management section, click Manage Service Applications.

  3. 在 [管理服務應用程式] 頁面上,按一下服務應用程式清單中的 [Search Service 應用程式]。On the Manage Service Applications page, in the list of service applications, click the Search service application.

  4. 在 [搜尋管理] 頁面上的 [正在編目] 區段中按一下 [編目規則On the Search Administration page, in the Crawling section, click Crawl Rules.

  5. 在 [管理編目規則] 頁面的編目規則清單中指向您要刪除、 按一下出現箭號,然後按一下 [刪除的編目規則的名稱。On the Manage Crawl Rules page, in the list of crawl rules, point to the name of the crawl rule that you want to delete, click the arrow that appears, and then click Delete.

  6. 按一下[確定]確認您想要刪除此編目規則]。Click OK to confirm that you want to delete this crawl rule.

錄製編目規則To reorder crawl rules

  1. 確認執行此程序的使用者帳戶是否為 Search Service 應用程式的管理員。Verify that the user account that is performing this procedure is an administrator for the Search service application.

  2. 在管理中心的 [應用程式管理] 區段中,按一下 [管理服務應用程式]。In Central Administration, in the Application Management section, click Manage Service Applications.

  3. 在 [管理服務應用程式] 頁面上,按一下服務應用程式清單中的 [Search Service 應用程式]。On the Manage Service Applications page, in the list of service applications, click the Search service application.

  4. 在 [搜尋管理] 頁面上的 [正在編目] 區段中按一下 [編目規則On the Search Administration page, in the Crawling section, click Crawl Rules.

  5. 在 [管理編目規則] 頁面的 [順序] 欄中的編目規則清單中指定您想要佔用之規則的編目規則位置。據以移動其他值。On the Manage Crawl Rules page, in the list of crawl rules, in the Order column, specify the crawl rule position that you want the rule to occupy. Other values shift accordingly.