顯示混合式同盟 SharePoint Online 中的搜尋結果Display hybrid federated search results in SharePoint Online

摘要:設定 SharePoint 混合式環境,以便從 SharePoint Online 搜尋中心的使用者搜尋能夠顯示來自 SharePoint Online 和 SharePoint Server 搜尋索引的結果。Summary: Configure a SharePoint hybrid environment so that user searches from the SharePoint Online Search Center display results from both the SharePoint Online and SharePoint Server search indexes.

本文是設定 SharePoint 混合式解決方案程序藍圖的一部分。當您執行本文中的程序時,請確定您遵循藍圖This article is part of a roadmap of procedures for configuring SharePoint hybrid solutions. Be sure you're following a roadmap when you do the procedures in this article.

本文說明如何設定混合式 SharePoint 環境,以便 SharePoint Online 企業搜尋中心搜尋時顯示混合式結果 — 搜尋索引 (SharePoint Online 和 SharePoint Server) 亦即從兩者的結果。此設定會呼叫輸入混合式搜尋。This article describes how to configure a hybrid SharePoint environment so that searches from the SharePoint Online enterprise Search Center display hybrid results—that is, results from both search indexes (SharePoint Online and SharePoint Server). This configuration is called inbound hybrid search.

從 SharePoint Server,但在呼叫結果區塊的個別群組中的搜尋結果會顯示來自 SharePoint Server 搜尋結果。您可以設定 SharePoint Server 會顯示高於所有結果從 SharePoint Online、 或透過比較 SharePoint Online 結果的相關性排名的結果區塊。The search results from SharePoint Server will appear with the search results from SharePoint Server, but in a separate group called a result block. You can configure the block of results from SharePoint Server to be shown above all the results from SharePoint Online, or to be ranked by relevance compared to the SharePoint Online results.

若要在 SharePoint Online 搜尋中心的 SharePoint Online 中顯示混合式搜尋結果您執行詳細說明本文中的下列程序:To display hybrid search results in the SharePoint Online Search Center, in SharePoint Online you perform the following procedures, which are described in detail in this article:

步驟 1:建立結果來源以定義如何從 SharePoint Server 2013 部署取得搜尋結果Step 1: Create a result source that defines how to get search results from the SharePoint Server 2013 deployment

在此程序,您可以建立 SharePoint Online 中的結果來源。這種結果來源是指定做為取得搜尋結果的提供者的 SharePoint Server 的定義。這個定義指定下列各項:In this procedure, you create a result source in SharePoint Online. This result source is a definition that specifies SharePoint Server as a provider to get search results from. This definition specifies each of the following:

  • 從 SharePoint Server 部署取得搜尋的通訊協定結果。The protocol for getting search results from the SharePoint Server deployment.

  • 反向 proxy 裝置的 URL。反向 proxy 裝置會從 SharePoint Online 搜尋查詢轉寄至 SharePoint Server 的部署。The URL of the reverse proxy device. The reverse proxy device forwards search queries from SharePoint Online to the SharePoint Server deployment.

  • 用於儲存 Secure Store SSL 憑證的目標應用程式 ID。The ID of the target application that stores the Secure Store SSL certificate.

您可以在 SharePoint 系統管理中心層級、網站集合層級或網站層級建立結果來源。在此程序中,您會在 SharePoint 系統管理中心層級建立結果來源。此舉將會使結果來源可供在相同層級建立的任何查詢規則,以及針對網站集合或某個網站建立的任何查詢規則使用。Result sources can be created at the SharePoint Admin Center level, the site collection level, or the site level. In this procedure, you create the result source at the SharePoint Admin Center level. This makes the result source available to any query rule that is created at the same level, and also to any query rule that is created for a site collection or site.

如需結果來源的詳細資訊,請參閱了解結果來源管理結果來源For more information about result sources, see Understanding result sources and Manage result sources.

  1. 確認您用來執行此程序的使用者帳戶是您想要設定之 Office 365 訂閱的全域管理員。Verify that the user account that you use to perform this procedure is a global administrator for the Office 365 subscription that you want to configure.

  2. 在 SharePoint Online 系統管理中心的 [快速啟動] 中按一下 [搜尋]。In the SharePoint Online Admin Center, in the Quick Launch, click search.

  3. 按一下 [搜尋管理] 頁面的 [管理結果來源]。On the search administration page, click Manage Result Sources.

  4. 按一下 [新增結果來源Click New Result Source.

  5. 在您可以建立新結果來源的頁面上,執行下列動作:On the page where you can create a new result source, do the following:

    • 在 [一般資訊] 區段的 [名稱] 文字方塊中輸入新結果來源的名稱 — 例如,Get results from SharePoint Server 2013。In the General Information section, in the Name text box, type a name for the new result source—for example, Get results from SharePoint Server 2013.

      用以從 SharePoint Server 2013 取得混合式搜尋結果的前四個結果來源頁面區段

    • (選用)在 [一般資訊] 區段的 [描述] 文字方塊中輸入新結果來源的描述。此描述將會顯示為工具提示時將滑鼠指標放在特定設定頁面上的結果來源。(Optional) In the General Information section, in the Description text box, type a description of the new result source. This description will appear as a tooltip when the pointer rests on the result source on certain configuration pages.

    • 在 [通訊協定] 區段中,選取 [遠端 SharePoint]。In the Protocol section, select Remote SharePoint.

    • 在 [遠端服務 URL ] 區段中,輸入反向 proxy 裝置之外部端點的地址例如https://spexternal.adventureworks.com。反向 proxy 裝置路由 SharePoint Online 中送出至 SharePoint Server 部署的查詢。如需詳細資訊,請參閱 < Configure SharePoint Server 混合式的反向 proxy 裝置。反向 proxy 裝置之外部端點是其網際網路對向端點。該外部端點的地址會呼叫的外部 URL。取得您具有已維護的SharePoint 混合式工作表的外部 URL] 列在表格 3 的外部 URL 值和在 [遠端服務 URL ] 文字方塊中輸入它。In the Remote Service URL section, type the address of the external endpoint of the reverse proxy device, such as https://spexternal.adventureworks.com. The reverse proxy device routes queries that are submitted in SharePoint Online to the SharePoint Server deployment. For more information, see Configure a reverse proxy device for SharePoint Server hybrid. The external endpoint of the reverse proxy device is its Internet-facing endpoint. The address of that external endpoint is called the external URL. Get the value of the external URL from the External URL row in Table 3 of the SharePoint hybrid worksheet that you have been maintaining, and type it in the Remote Service URL text box.

    • 在 [類型] 區段中,選取 [SharePoint 搜尋結果]。In the Type section, select SharePoint Search Results.

    • 您可以在 [查詢轉換] 區段中輸入要將搜尋結果縮小至指定的子集的查詢轉換 — 例如,已從特定的 SharePoint 網站集合或網站的子集。不過,如果您熟悉查詢轉換 SharePoint Server 或 SharePoint Online、 建議該您保留預設查詢轉換] 文字方塊中。預設轉換是{searchTerms},這是查詢變數代表查詢的使用者輸入,因為它由最近查詢轉換所變更。如果您熟悉查詢轉換您可以在 [文字] 方塊中輸入不同的查詢轉換或啟動查詢產生器來協助您設定查詢轉換所變更預設查詢轉換。如需詳細資訊,請參閱規劃轉換查詢和順序結果 in SharePoint ServerSharePoint Server 中的查詢變數In the Query Transform section you can enter a query transform to narrow the search results to a specified subset—for example, a subset that is from a particular SharePoint site collection or site. However, if you are not familiar with query transforms in SharePoint Server or SharePoint Online, we recommend that you keep the default query transform that's in the text box. The default transform is {searchTerms}, which is a query variable that stands for the query that the user typed, as it was changed by the most recent query transform. If you are familiar with query transforms you can change the default query transform by either typing a different query transform in the text box or launching the Query Builder to help you configure a query transform. For more information, see Plan to transform queries and order results in SharePoint Server and Query variables in SharePoint Server.

      SharePoint Online 中新結果來源頁面上的查詢轉換和認證資訊區段

    • 如果您連線至您的組織內部網路透過 [認證資訊] 區段中的反向 proxy 選取 [ SSO 識別碼和再反向 proxy 憑證 (Secure Store Id)在文字方塊中,輸入目標的名稱應用程式-(例如,securechanneltargetapp) — 這會儲存 Windows 憑證將用來驗證反向 proxy 裝置。取得您具有已維護的SharePoint 混合式工作表[表 6 中的 [目標應用程式識別碼] 列的目標應用程式的名稱和輸入在反向 proxy 憑證 (Secure Store Id) ] 文字方塊中。If you are connecting to your organization's intranet through a reverse proxy, in the Credentials Information section, select SSO Id and then in the Reverse proxy certificate (Secure Store Id) text box, type the name of the target application—for example, SecureChannelTargetApp—which stores the Windows certificate that will be used to authenticate to the reverse proxy device. Get the name of the target application from the Target Application ID row in Table 6 of the SharePoint hybrid worksheet that you have been maintaining, and enter it in the Reverse proxy certificate (Secure Store Id) text box.

    • 按一下 [確定] 儲存新的結果來源。Click OK to save the new result source.

步驟 2:建立查詢規則以在 SharePoint Online 中開啟混合搜尋結果Step 2: Create a query rule to turn on hybrid search results in SharePoint Online

在此程序,您可以建立 SharePoint Online 中使用您在本文中的上一個程序中建立的結果來源的查詢規則。時就會引發查詢規則,因此而導致搜尋結果的內容從 SharePoint Server 的 SharePoint Online 中的搜尋結果頁面上的結果區塊中顯示的搜尋索引。In this procedure, you create a query rule in SharePoint Online that uses the result source that you created in the previous procedure in this article. When the query rule fires, it causes search results from content in the SharePoint Server search index to be displayed in a result block on a search results page in SharePoint Online.

可以在 SharePoint 系統管理中心層級、 網站集合層級或網站層級建立查詢規則。在此程序,您可在 SharePoint 系統管理中心層級建立查詢規則。因為您在此層級建立規則,規則可以套用至任何使用者送出這個執行個體的 SharePoint Online 中的查詢。Query rules can be created at the SharePoint Admin Center level, the site collection level, or the site level. In this procedure, you create a query rule at the SharePoint Admin Center level. Because you create the rule at this level, the rule can apply to any queries that users submit in this instance of SharePoint Online.

如需查詢規則的詳細資訊,請參閱規劃轉換查詢和順序結果 in SharePoint ServerSharePoint Server 中的管理查詢規則For more information about query rules, see Plan to transform queries and order results in SharePoint Server and Manage query rules in SharePoint Server

  1. 確認您用來執行此程序的使用者帳戶是您想要設定之 Office 365 訂閱的全域管理員。Verify that the user account that you use to perform this procedure is a global administrator for the Office 365 subscription that you want to configure.

  2. 在 SharePoint Online 系統管理中心的 [快速啟動] 中按一下 [搜尋]。In the SharePoint Online Admin Center, in the Quick Launch, click search.

  3. 在 [搜尋管理] 頁面上按一下 [管理查詢規則]。On the search administration page, click Manage Query Rules.

  4. 在 [管理查詢規則] 頁面上執行下列動作:On the Manage Query Rules page, do the following:

    • 文字下方哪一種內容執行動作您要設定規則?,在 [選取結果來源] 下拉式清單中,選取您想要套用此查詢規則的結果來源。進行測試時,建議您選取[本機 SharePoint 結果結果來源此處。如果這麼做,則預設查詢規則將會是適用於當使用者執行查詢中每個項目] 搜尋類別中的企業搜尋中心,因為該垂直預設使用本機 SharePoint 結果結果來源。從下拉式清單中選取結果來源之後,套用至該結果來源的所有現有查詢規則會出現在頁面。(在_Search_service_application_name_: 新增查詢規則] 頁面的 [內容] 區段中,您將能夠新增或移除想要套用規則的結果來源。)Under the text For what context do you want to configure rules?, in the Select a Result Source drop-down list, select a result source for which you want this query rule to be applicable. For testing, we recommend that you select the Local SharePoint Results result source here. If you do so, then by default the query rule will be applicable when a user performs a query in the Everything search vertical in the enterprise Search Center, because that vertical uses the Local SharePoint Results result source by default. After you select a result source from the drop-down list, all existing query rules that apply to that result source appear on the page. (On the Search_service_application_name: Add Query Rule page, in the Context section, you will be able to add or remove result sources for which you want the rule to be applicable.)

      SharePoint Server 2013 中管理查詢規則頁面的內容區段

    • (選用)文字下方哪一種內容執行動作您要設定規則?,在使用者區段] 下拉式清單中,選取您想要套用此查詢規則的使用者區段。使用者區段根據 Managed Metadata service 應用程式的字詞庫中描述使用者的字詞。(在 [新增查詢規則] 頁面的 [內容] 區段中,您將能夠新增或移除想要套用規則的使用者區段。)(Optional) Under the text For what context do you want to configure rules?, in the User Segments drop-down list, select a user segment for which you want this query rule to be applicable. User segments are based on terms that describe users in the term store of a Managed Metadata service application. (On the Add Query Rule page, in the Context section, you will be able to add or remove user segments for which you want the rule to be applicable.)

    • (選用)文字下方哪一種內容執行動作您要設定規則?主題類別下拉式清單中,選取您想要套用此查詢規則的主題類別。主題類別根據 Managed Metadata service 應用程式的字詞庫中類別的字詞。(在 [新增查詢規則] 頁面的 [內容] 區段中,您將能夠新增或移除想要套用規則的類別。)(Optional) Under the text For what context do you want to configure rules?, in the Topic Categories drop-down list, select a topic category for which you want this query rule to be applicable. Topic categories are based on terms for categories in the term store of a Managed Metadata service application. (On the Add Query Rule page, in the Context section, you will be able to add or remove categories for which you want the rule to be applicable.)

    • 按一下 [新增查詢規則Click New Query Rule.

  5. 在 [新增查詢規則] 頁面上執行下列動作:On the Add Query Rule page, do the following:

    • 在 [一般資訊] 區段的 [規則名稱] 文字方塊中輸入新查詢規則的名稱 — 例如,Show results from SharePoint Server。In the General Information section, in the Rule Name text box, type a name for the new query rule—for example, Show results from SharePoint Server.

    • 如果 [內容] 區段已摺疊,按一下以展開它的快顯] 旁的箭號。If the Context section is collapsed, click the arrow next to Context to expand it.

      SharePoint Server 2013 中新增查詢規則頁面的內容區段

    • 在 [內容] 區段的 [查詢會在這些來源上執行,請選取 [所有來源如果您想要套用的查詢使用者針對任何結果來源、 送出或選取都 [這些來源之一,此查詢規則並加上 then(選用) 按一下 [新增來源] 新增您想要套用查詢規則的其他結果來源。In the Context section, under Query is performed on these sources, select All sources if you want this query rule to be applicable for queries that users submit against any result source, or select One of these sources, and then optionally click Add Source to add other result sources for which you want the query rule to be applicable.

      注意

      選取結果來源,您在_Search_service_application_name_:新增查詢規則] 頁面 (例如,本機 SharePoint 結果-請參閱此程序的步驟 5a) 將會顯示 [這些來源之一] 下方。> 當您選取 [這些來源之一],此查詢規則會是只有當使用者送出查詢針對其中一個這份清單中的結果來源時才適用。因此,確定 [結果來源出現您想要套用此查詢規則 — 例如,本機 SharePoint 結果The result source that you selected on the Search_service_application_name: Add Query Rule page (for example, Local SharePoint Results—see step 5a of this procedure) will be shown under One of these sources. > When you select One of these sources, this query rule will be applicable only when a user submits a query against one of the result sources in this list. Therefore, make sure that the result source appears for which you want this query rule to be applicable—for example, Local SharePoint Results.

    • (選用)在 [從這些類別執行查詢,指定主題類別 (根據主題中的類別字詞的受管理的中繼資料服務應用程式字詞庫) 執行的查詢。(Optional) Under Query is performed from these categories, specify the topic categories (based on terms for topic categories in the term store of a Managed Metadata service application) to perform the query from.

    • (選用)在 [查詢都由這些使用者區段,指定使用者區段 (根據可說明使用者在受管理的中繼資料服務應用程式的字詞庫中字詞) 至您想要套用的查詢規則。(Optional) Under Query is performed by these user segments, specify user segments (based on terms that describe users in the term store of a Managed Metadata service application) to which you want the query rule to apply.

    • 在 [查詢條件] 區段中,指定條件以控制何時規則觸發,按一下 [移除條件] 如果您想要對任何查詢文字觸發的規則。進行測試時,建議您按一下 [移除條件,使規則對於任何查詢文字觸發。In the Query Conditions section, specify conditions to control when the rule will fire, or click Remove Condition if you want the rule to fire for any query text. For testing, we recommend that you click Remove Condition so that the rule will fire for any query text.

      SharePoint Server 2013 中新增查詢規則頁面的查詢條件區段

    • 在 [動作] 區段中的 [結果區塊] 下按一下 [新增結果區塊]。In the Actions section, under Result Blocks, click Add Result Block.

      SharePoint Server 2013 中 [新增結果區塊] 對話方塊的螢幕擷取畫面

    • (選用)在 [區塊標題] 區段的 [標題] 文字方塊中標題變更為您想要顯示在搜尋結果頁面上,例如"{subjectTerms}"結果從 SharePoint 伺服器上的結果區塊上方的文字。(Optional) In the Block Title section, in the Title text box, change the title to the text that you want to display above the result block on the search results page, such as Results for "{subjectTerms}" from SharePoint Server.

    • 您可以在 [查詢] 區段中輸入您想要執行的查詢。如果您熟悉查詢轉換 SharePoint Server 或 SharePoint Online、 建議該您保留預設查詢轉換] 文字方塊中。預設轉換是{searchTerms}。如果您熟悉查詢轉換您可以在 [文字] 方塊中輸入不同的查詢轉換或啟動查詢產生器來協助您設定查詢轉換所變更預設查詢轉換。如需詳細資訊,請參閱規劃轉換查詢和順序結果 in SharePoint ServerSharePoint Server 中的查詢變數In the Query section, you can enter the query you want to run. If you are not familiar with query transforms in SharePoint Server or SharePoint Online, we recommend that you keep the default query transform that's in the text box. The default transform is {searchTerms}. If you are familiar with query transforms you can change the default query transform by either typing a different query transform in the text box or launching the Query Builder to help you configure a query transform. For more information, see Plan to transform queries and order results in SharePoint Server and Query variables in SharePoint Server.

    • 在 [查詢] 區段的 [搜尋此來源] 下拉式清單中,選取您在本文中的上一個程序中建立結果來源的名稱 (步驟 1: 建立定義如何取得搜尋結果的結果來源SharePoint Online) — 例如,Get results from SharePoint Server。In the Query section, in the Search this Source drop-down list, select the name of the result source that you created in the previous procedure in this article ( Step 1: Create a result source that defines how to get search results from SharePoint Online)—for example, Get results from SharePoint Server.

    • 在 [查詢] 區段中的項目] 下拉式清單中,選取 [從您要顯示搜尋結果頁面上的結果區塊中的 SharePoint Server 的搜尋結果數目。例如,選取 [ 3 ] 此結果區塊中顯示來自 SharePoint Server 的三個結果。In the Query section, in the Items drop-down list, select the number of search results from SharePoint Server that you want to show in this result block on the search results page. For example, select 3 to display three results from SharePoint Server in this result block.

    • 如果您想要顯示在結果區塊的底端顯示更多連結、 展開 [設定] 區段中選取多個連結會移至下列 URL,並輸入會顯示來自 SharePoint Server 的更多結果] 頁面上的連結的 URL搜尋索引。例如,將指定的主要搜尋結果頁面為顯示更多結果] 頁面上,通常是您可以輸入下列格式的 URL (後面加上"?k = {subjectTerms}"為一般使用者的搜尋查詢以): http:// Tenant_Name.sharepoint.com/網站 / Search_Center_Name/pages/results.aspx?k={subjectTerms}。當使用者按一下 [顯示更多時,就會看到更多結果的結果區塊。If you want to display a Show More link at the bottom of the result block, expand the Settings section and select More link goes to the following URL, and type the URL for the link to a page that displays more results from the SharePoint Server search index. For example, to specify the main search results page as the page that displays more results, typically you can type a URL of the following form (followed by "?k={subjectTerms}" to signify the user's search query): http:// Tenant_Name.sharepoint.com/sites/ Search_Center_Name/pages/results.aspx?k={subjectTerms}. When end users click Show More, they will see more results for the result block.

    • 指定從 SharePoint Server 相對於從 SharePoint Online 結果的結果區塊的位置。選取 [此區塊永遠會核心結果上方的搜尋結果第一頁的頂端或附近顯示結果區塊]。在此例中核心結果就是從 SharePoint Online 搜尋索引的結果。此選項很有用的測試、 或大部分的相關的內容位於遠端搜尋索引中的混合式環境。如果您選取此選項的多個結果區塊時,您可以設定結果區塊的排名相關聯的查詢規則的顯示的順序。選取 [顯示結果區塊如此它透過相較於在核心結果的相關性排名,這種情況的結果區塊可能不會出現在搜尋結果的第一頁上的 [此區塊排名內核心結果 (可能不會顯示) 。此為預設設定,通常是較適合實際執行環境中的選擇。做為個別結果的結果區塊排名可能會不同使用者在稍後執行相同的查詢時。例如,如果使用者按一下 [結果區塊中的搜尋結果] 結果區塊會被排名更搜尋結果中一段時間。否則請結果區塊會是依排名較低一段時間。Specify the placement of the block of results from SharePoint Server relative to the results from SharePoint Online. Select This block is always shown above core results to display the result block at or near the top of the first page of search results. In this case, core results are the results from the SharePoint Online search index. This option is useful for testing, or when most of the relevant content is located in the remote search index in the hybrid environment. If you select this option for more than one result block, you can configure the order in which the result blocks are displayed by ranking the associated query rules. Select This block is ranked within core results (may not show) to display the result block such that it is ranked by relevance compared to the core results, in which case the result block might not appear on the first page of search results. This is the default setting and is typically the more appropriate choice in a production environment. As with individual results, the rank of the result block might be different when users perform the same query later. For example, if users click search results in the result block, the result block will be ranked higher in the search results over time. Otherwise, the result block will be ranked lower over time.

    • (選用)在 [群組顯示範本 URL ] 文字方塊中指定群組顯示範本的不同的 URL。(Optional) Specify a different URL for the group display template in the Group Display Template URL text box.

    • (選用)在 [項目顯示範本] 文字方塊中指定的項目顯示範本(Optional) Specify an item display template in the Item Display Template text box,

    • 略過 [路由] 區段。Skip the Routing section.

    • 按一下 [新增結果區塊的[確定]Click OK to add the result block.

  6. (選用)指定當查詢規則應為作用中。在 [發佈] 區段中使用欄位 [開始日期結束日期檢閱日期] 及連絡人。開始日期和結束日期指定查詢規則時將使用中。如果您指定沒有結束日期是開始日期、 規則一律是使用中的開始日期之後。如果您指定的開始日期沒有結束日期、 規則一律是使用中的結束日期之前。如果您未指定開始日期或結束日期,一律會使用中文規則。(Optional) Specify when the query rule shall be active. In the Publishing section, use the Start Date, End Date, Review Date, and Contact fields. The start date and end date specify when the query rule will be active. If you specify a start date without an end date, the rule will always be active after the start date. If you specify an end date without a start date, the rule will always be active until the end date. If you do not specify a start date or an end date, the rule will always be active.

  7. 在 [發佈] 區段中選取 [是使用中啟用查詢規則。使用中查詢規則時,它就會引發查詢條件符合時。Activate the query rule by selecting Is Active in the Publishing section. When a query rule is active, it fires whenever the query conditions are met.

  8. 按一下 [儲存]。Click Save.

在幾分鐘,當從 SharePoint Online 搜尋中心針對所指定的結果來源的同盟的使用者送出查詢步驟 5 的此程序之後, 就會看到這兩個搜尋索引的結果如下列螢幕擷取畫面所示。在螢幕擷取畫面的 SharePoint Server 的兩個搜尋結果區塊會出現在搜尋結果上方從 SharePoint Online。After a few moments, when federated users submit queries from the SharePoint Online Search Center against a result source that you specified in step 5 of this procedure, they will see results from both search indexes, as shown in the following screen shot. In the screen shot, a block of two search results from SharePoint Server appears above the search results from SharePoint Online.

注意

同盟的使用者是內部部署 Active Directory 網域服務 (AD DS) 網域帳戶會同步處理 SharePoint Server 與 SharePoint Online、 之間及誰存取這兩個環境中的資源由同盟身分識別與驗證提供者,例如 Active Directory Federation Services (AD FS) 2.0。A federated user is a user whose on-premises Active Directory Domain Services (AD DS) domain account is synchronized between SharePoint Server and SharePoint Online, and who accesses resources in both environments by authenticating with the federation identity provider, such as Active Directory Federation Services (AD FS) 2.0.

SharePoint Online 中混合式搜尋結果的螢幕擷取畫面

步驟 3:測試您的設定以便在 SharePoint Online 中顯示來自 SharePoint Server 2013 的搜尋結果Step 3: Test your configuration for displaying search results from SharePoint Server 2013 in SharePoint Online

若要驗證您的設定以便在 SharePoint Online 中檢視搜尋結果從 SharePoint Server 部署中使用下列程序。Use the following procedure to validate your configuration for viewing search results from the SharePoint Server deployment in SharePoint Online.

重要

如果您使用單一登入 (SSO) 驗證,務必使用同盟的使用者帳戶,以測試混合式搜尋功能。原生 Office 365 使用者帳戶和非同盟的 AD 帳戶不會辨識這兩個目錄服務。因此,無法使用 SSO 進行驗證,且不能授與權限給這兩個環境中的資源。如需詳細資訊,請參閱帳戶所需的混合式設定和測試If you are using single sign-on (SSO) authentication, it is important to test the hybrid Search functionality by using federated user accounts. Native Office 365 user accounts and AD accounts that are not federated are not recognized by both directory services. Therefore, they cannot authenticate using SSO and cannot be granted permissions to resources in both environments. For more information, see Accounts needed for hybrid configuration and testing.

  1. 確認您用來執行此程序的使用者帳戶是誰已經啟用在 SharePoint Online 中且有權檢視根網站集合的同盟的使用者。Verify that the user account that you use to perform this procedure is a federated user who has been activated in SharePoint Online, and who has permissions to view the root site collection there.

  2. 在 SharePoint 管理中心] 頁面上,按一下 [搜尋]。On the SharePoint Admin Center page, click search.

  3. 在 [搜尋管理] 頁面上按一下 [管理查詢規則]。On the search administration page, click Manage Query Rules.

  4. 在用於管理查詢規則的頁面上,執行下列動作:On the page for managing query rules, do the following:

  5. 在要編輯 [動作] 區段的 [結果區塊] 子區段中的查詢規則] 頁面上的 [名稱旁邊的 [查詢規則,會顯示結果從 SharePoint Server 搜尋索引 (例如顯示結果從 SharePoint Server2013),按一下 [編輯]。On the page for editing the query rule, in the Actions section, in the Result Blocks subsection, next to the name of the query rule that will show results from the SharePoint Server search index (for example, Show results from SharePoint Server 2013), click edit.

  6. 在 [編輯結果區塊] 對話方塊中 [查詢] 區段中按一下 [啟動查詢建立器]。In the edit result block dialog box, in the Query section, click Launch Query Builder.

  7. 在 [基礎] 索引標籤的 [建立您的查詢] 對話方塊中執行下列動作:In the build your query dialog box, on the BASICS tab, do the following:

  8. 按一下 [測試查詢]。Click Test query.

    在 [搜尋結果預覽] 窗格中,如果是有效的搜尋組態和 SharePoint Server 中有相關的結果的 SharePoint Online 的搜尋系統會顯示來自 SharePoint Server 搜尋結果。如果您的設定問題,搜尋系統可以顯示的疑難排解資訊。In the Search Result Preview pane, if your search configuration is valid and there are relevant results in SharePoint Server, the SharePoint Online search system will display search results from SharePoint Server. If there are problems with your configuration, the search system can display troubleshooting information.

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

步驟 4:嘗試從 SharePoint Online 搜尋中心搜尋Step 4: Try a search from the SharePoint Online Search Center

若要驗證您的設定以便在 SharePoint Online 搜尋中心中顯示來自 SharePoint Server 與 SharePoint Online 的搜尋結果,您可以 to SharePoint Online 的同盟使用者身分登入並嘗試某些企業搜尋中心搜尋時。使用下列程序驗證您以這種方式的設定。To validate your configuration for displaying search results from both SharePoint Server and SharePoint Online in the SharePoint Online Search Center, you can log on to SharePoint Online as a federated user and try some searches from the enterprise Search Center. Use the following procedure to validate your configuration in this way.

  1. 登入 SharePoint Online 人員在 SharePoint Online 中已經啟用且有權檢視根網站集合的同盟使用者。Log on to SharePoint Online as a federated user who has been activated in SharePoint Online, and who has permissions to view the root site collection there.

  2. 移至企業在 SharePoint Online 搜尋中心。Go to the enterprise Search Center in SharePoint Online.

    企業在 SharePoint Online 搜尋中心通常位於 https://<網域>.sharepoint.com/search—for 範例https://adventureworks.sharepoint.com/search。Typically, the enterprise Search Center in SharePoint Online is at https://< domain>.sharepoint.com/search—for example, https://adventureworks.sharepoint.com/search.

  3. 在企業搜尋中心,執行下列動作:In the enterprise Search Center, do the following:

    • 在搜尋方塊中,輸入測試查詢,例如貴公司的名稱。In the search box, type a test query, such as the name of your company.

      確定測試查詢應從 SharePoint Server 搜尋索引和 SharePoint Online 搜尋索引產生搜尋結果。Make sure that the test query should yield search results from the SharePoint Server search index and the SharePoint Online search index.

    • 按一下 [搜尋] 圖示,或按下 Enter 鍵。Click the search icon, or press Enter.

    • 按一下 [使用您在步驟指定 5c 的本文中的第二個程序的結果來源的搜尋類別 (步驟 2: 建立查詢規則以在 SharePoint Online 的混合式搜尋結果在開啟),例如[本機 SharePoint 結果。也就是說,按一下您在 [新增查詢規則] 頁面的 [內容] 區段的 [查詢會在這些來源上執行指定的搜尋類別。Click a search vertical that uses a result source that you specified in step 5c of the second procedure in this article (Step 2: Create a query rule to turn on hybrid search results in SharePoint Online), such as Local SharePoint Results. That is, click a search vertical that you specified on the Add Query Rule page, in the Context section, under Query is performed on these sources.

  4. 在搜尋結果] 頁面上,您應該會看見來自 SharePoint Online 搜尋索引的結果,以及從 SharePoint Server 搜尋索引結果區塊。On the search results page, you should see results from the SharePoint Online search index and a result block from the SharePoint Server search index.

    注意

    若要檢視已從 SharePoint 伺服器陣列中的內容的搜尋結果的目標,使用者必須至少具有讀取根網站集合中的主要 web 應用程式的權限。(在 SharePoint 混合式環境中,主要 web 應用程式是 SharePoint 伺服器陣列中的伺服器和用來從 Office 365 接收所有的連線。如需主要 web 應用程式的詳細資訊,請參閱 「規劃從 Office 365 至 SharePoint Server 的連線)。To view the target of a search result that is from content in the SharePoint Server farm, a user must have at least Read permission for the root site collection in the primary web application. (In a SharePoint hybrid environment, the primary web application is in the SharePoint Server farm and is used to receive all connections from Office 365. For more information about the primary web application, see Plan connectivity from Office 365 to SharePoint Server.)

  5. 如果您未在搜尋結果頁面上看見來自這兩個搜尋索引的結果,請執行下列動作:If you do not see results from both search indexes on the search results page, do the following:

    • 確認 SharePoint Server 中的搜尋系統已編目本機內容。Verify that the search system in SharePoint Server has crawled the local content.

    • 確認您已設定搜尋功能如本文所述。Verify that you have configured Search features and functionality as described in this article.

    • 修正任何錯誤或遺漏,然後再次嘗試搜尋。Correct any errors or omissions, and try a search again.

  6. 如果您仍未看見來自兩個搜尋索引的搜尋結果,請檢查 SharePoint 統一登入服務 (ULS) 記錄檔,也稱為 SharePoint 追蹤記錄檔。If you still do not see search results from both search indexes, check the SharePoint Unified Logging Service (ULS) logs, also called the SharePoint trace logs.

    如需詳細資訊,請參閱統一登入系統 (ULS) 記錄概觀 (英文)。For more information, see Overview of Unified Logging System (ULS) Logging.

另請參閱See also

概念Concepts

Plan hybrid federated search for SharePoint ServerPlan hybrid federated search for SharePoint Server