階段 4: 設定搜尋並啟用在 SharePoint Server 中的目錄內容的編目Stage 4: Set up search and enable the crawling of your catalog content in SharePoint Server

摘要:了解如何設定搜尋並啟用在 SharePoint Server 2016 目錄內容的編目。Summary: Learn how to set up search and enable crawl of your catalog content in SharePoint Server 2016.

注意

大部分的這一系列中所述的功能是僅適用於 SharePoint Online 中的私人每個網站集合。Most of the features described in this series are available only for private sites collections in SharePoint Online.

快速概觀Quick overview

中所述階段 3: 如何啟用清單作為目錄 in SharePoint Server、 [產品] 清單現在已啟用為目錄。我們將會使用搜尋技術來擷取並顯示我們發佈網站 (Contoso 網站) 上的內容,我們必須編目目錄,讓其內容新增至搜尋索引。As described in Stage 3: How to enable a list as a catalog in SharePoint Server, the Products list has now been enabled as a catalog. As we'll be using search technology to retrieve and display content on our publishing site (the Contoso website), we have to crawl the catalog so that its content is added to the search index.

在本文中,您將了解:In this article, you'll learn:

啟動階段 4Start stage 4

關於編目About crawling

根據您的權限層級,您可以從兩個位置開始編目:Depending on your permission level, you can start a crawl from two places:

開始編目的位置Where to start crawl 必要的權限層級Required permission level
管理中心Central Administration
Search Service 應用程式管理員Search service application administrator
在資料庫目錄On the catalog
網站集合管理員Site collection administrator

您可以從兩個位置開始編目的原因是使用目錄內容 (我們呼叫這些內容管理員) 的人員感可能性搜尋服務應用程式管理員的權限。換句話說,沒有管理中心存取權。The reason that you can start a crawl from two places is that people who are working with catalog content (let's call them content managers) are unlikely to have Search service application administrator rights. In other words, they don't have access to Central Administration.

當變更目錄內容時,它合理使它可以顯示在發佈網站的許多快速編目此內容。When changes are made to catalog content, it makes sense to crawl this content fairly quickly so that it can be displayed on the publishing site.

幸好內容管理員可以讓新的內容可供不必 pester Search service 應用程式管理員執行新的編目。我們將會回來如何執行這項作業稍後的本文中,但第一次我們查看如何在管理中心啟動完整編目。Luckily, content managers can make new content available without having to pester Search service application administrators to run new crawls. We'll come back to how to do this later in this article, but first let's look at how to start a full crawl in Central Administration.

如何在管理中心啟動完整編目How to start a full crawl in Central Administration

您可以在管理中心啟動完整編目之前,您必須指定應該要編目的內容來源。當您執行完整編目時,即使該內容已新增至搜尋索引編目內容來源中的所有內容。Before you can start a full crawl in Central Administration, you must specify which content source should be crawled. When you run a full crawl, all content in the content source is crawled even if that content has already been added to the search index.

針對此案例,我們將本機 SharePoint網站內容來源進行編目。For this scenario, we'll crawl the Local SharePoint sites content source.

  1. 移至 [管理中心 --> 管理服務應用程式 --> Search Service 應用程式->內容來源Go to Central Administration --> Manage service applications --> Search Service Application -- > Content Sources.

  2. 在 [管理內容來源] 頁面上[本機 SharePoint 網站內容來源,請先暫停並從功能表中選取 [啟動完整編目On the Manage Content Sources page, pause on the Local SharePoint sites content source, and select Start Full Crawl from the menu.

    選取 [啟動完整編目]

在 [狀態] 欄中顯示的編目狀態。The status of the crawl is shown in the Status column.

  1. 直到您看到 [狀態] 欄中的值為 [閒置的重新整理此頁面。這表示編目已完成。Refresh this page until you see that the value in the Status column is Idle. This means that the crawl has finished.

    編目狀態

  2. (選用) 您可以確認您的項目會依序按一下 [編目記錄檔新增至搜尋索引。在我們的案例中,我們現在有 870 中搜尋索引為大約是我們已在 [產品] 清單中的產品的相同數目的項目。Optionally, you can verify that your items are added to the search index by clicking Crawl Log. In our scenario, we now have 870 items in the search index, which is approximately the same number of products we have in the Products list.

    編目記錄檔

如何在管理中心的連續編目How to enable continuous crawls in Central Administration

您只能以手動方式啟動完整編目。有空想為這是未有效率也實用的方式運作以手動方式啟動編目目錄內容,以進行變更的每個時間的麻煩。因此,若要避免此額外負荷,您可以啟用您包含目錄的內容來源的連續編目You can only start a full crawl manually. Nobody wants the trouble of having to manually start a crawl every time that a change is made to their catalog content, as this is neither an efficient nor practical way to work. So, to avoid this overhead, you can enable a continuous crawl of your content source that contains the catalog.

連續編目自動啟動設定間隔。任何先前的編目後目錄所做的變更會挑選的編目並新增至搜尋索引。Continuous crawls start automatically at set intervals. Any changes that were made to the catalog after the previous crawl, are picked up by the crawler and added to the search index.

若要啟用連續編目:To enable continuous crawls:

  1. 移至 [管理中心 --> 管理服務應用程式 --> Search Service 應用程式 --> 內容來源Go to Central Administration --> Manage service applications --> Search Service Application --> Content Sources.

  2. 在 [管理內容來源] 頁面上按一下 [您要啟用連續編目,我們案例的案例中的內容來源],這是 [本機 SharePoint網站。On the Manage Content Sources page, click the content source for which you want to enable continuous crawl, in our scenario case, this is Local SharePoint sites.

  3. 選取 [啟用連續編目] 選項。Select the option Enable Continuous Crawls.

    啟用連續編目

如何設定連續編目間隔How to set continuous crawl interval

連續編目的預設間隔為 15 分鐘。您可以使用 PowerShell 設定較短的間隔。下列程式碼範例會將連續編目間隔設定為 1 分鐘。The default interval for continuous crawls is 15 minutes. You can set shorter intervals by using PowerShell. The code example below sets the continuous crawl interval to 1 minute.

$ssa = Get-SPEnterpriseSearchServiceApplication
$ssa.SetProperty("ContinuousCrawlInterval", 1)

如此,藉由啟用連續編目,就可以避免太多挫折感從內容管理員為他們不再需要等待 Search service 應用程式管理員為他們啟動編目。但是,針對某些目錄的變更,例如啟用為精簡器的 managed 的屬性、 連續編目不足,且必須進行完整的重新索引目錄內容。但不要擔心、 內容管理員有疑慮沒有理由因為會有一種方式,讓他們啟動完整的目錄重新索引。So, by enabling continuous crawls, you can avoid much frustration from content managers as they no longer have to wait for Search service application administrators to start a crawl for them. But, for some catalog changes, for example, enabling managed properties as refiners, continuous crawls are insufficient, and you have to do a full reindexing of the catalog content. But don't worry, content managers have no reason for concern because there is a way for them to initiate a full reindexing of the catalog.

如何啟動目錄重新索引How to initiate a reindexing of the catalog

若要標記為重新索引目錄,以下是您應該執行的動作:To mark a catalog for reindexing, here's what you should do:

  1. 在資料庫目錄 (在我們案例產品目錄網站集合中的 [產品] 清單中),按一下 [清單] 索引標籤--> [清單設定 --> 進階設定]On the catalog (in our scenario the Products list in the Product Catalog Site Collection), click the LIST tab --> List Settings --> Advanced Settings.

  2. 在 [進階設定] 頁面上,按一下 [重新編製索引的清單On the Advanced Settings page, click Reindex List.

    按一下重新索引清單

如何檢視編目狀態與目錄的排程How to view crawl status and schedule for a catalog

您可以檢視編目狀態與特定目錄的排程。若要執行這項作業:You can view the crawl status and schedule for a specific catalog. To do this:

  1. 在資料庫目錄 (在我們案例產品目錄網站集合中的 [產品] 清單中),按一下 [清單] 索引標籤--> [清單設定 --> 目錄設定On the catalog (in our scenario the Products list in the Product Catalog Site Collection), click the LIST tab --> List Settings --> Catalog Settings.

  2. 在 [目錄設定] 頁面上您可以看到目錄已上一次編目時,以及哪些編目排定要執行時。在我們的案例中,我們可以看到目錄上次在 5:30:17 AM 編目 2013/3/4 和連續編目已排定要執行每隔 15 分鐘。On the Catalog Settings page, you can see when the catalog was last crawled, and what crawls are scheduled to run when. In our scenario, we can see the catalog was last crawled on 3/4/2013 at 5:30:17 AM, and that continuous crawls are scheduled to run every 15 minutes.

    編目時間狀態

因此,內容管理員可以是高興因為其內容新增至搜尋索引簡短間隔和 Search service 應用程式管理員可以高興因為不再理會啟動編目內容管理員正比要求。So, content managers can be happy because their content is added to the search index at short intervals, and Search service application administrators can be happy because they are no longer bothered by content managers constantly asking them to start a crawl.

本系列中的下一篇文章Next article in this series

From site column to managed property - What's up with that?From site column to managed property - What's up with that?

另請參閱See also

其他資源Other Resources

設定跨網站發佈的搜尋Configure search for cross-site publishing