在 SharePoint Server 中設定 web 內容管理的結果來源Configure result sources for web content management in SharePoint Server

結果來源限制搜尋特定內容或搜尋結果的子集。SharePoint Server 提供 16 預先定義的結果來源。預先設定的預設結果來源為 [本機 SharePoint 結果。您可以指定不同的結果來源為預設值。除了預先設定的結果來源],SharePoint Server 自動建立結果來源時將發佈網站連線到目錄,並將其新增至發佈網站中的結果來源。這種結果來源限制搜尋結果 url 的目錄。如需結果來源的詳細資訊,請參閱 「 規劃結果來源和查詢規則 」 中規劃 SharePoint Server 2016 跨網站發佈網站的搜尋Result sources limit searches to certain content or to a subset of search results. SharePoint Server provides 16 pre-defined result sources. The pre-configured default result source is Local SharePoint Results. You can specify a different result source as the default. In addition to the pre-configured result sources, SharePoint Server automatically creates a result source when you connect a publishing site to a catalog, and adds it to the result sources in the publishing site. This result source limits search results to the URL of the catalog. For more information about result sources, see "Plan result sources and query rules" in Plan search for cross-site publishing sites in SharePoint Server 2016.

開始之前Before you begin

注意

因為在網際網路資訊服務 (IIS) 網站執行 SharePoint Server、 系統管理員和使用者而定的瀏覽器提供的協助工具功能。SharePoint Server 支援支援的瀏覽器的協助工具功能。如需詳細資訊,請參閱下列資源: >規劃瀏覽器支援> SharePoint 2013 的協助工具> SharePoint 2013 產品的協助工具功能> 快速鍵> 觸控Because SharePoint Server runs as websites in Internet Information Services (IIS), administrators and users depend on the accessibility features that browsers provide. SharePoint Server supports the accessibility features of supported browsers. For more information, see the following resources: > Plan browser support> Accessibility for SharePoint 2013> Accessibility features in SharePoint 2013 Products> Keyboard shortcuts> Touch

建議您先設定發佈網站、整合目錄,以及設定分類和目錄項目頁面,然後才開始建立結果來源。這是因為您之後就能更輕鬆地測試與確認如何將不同結果來源套用至您在網站上所擁有的其他搜尋網頁組件。We recommend that you set up the publishing site, integrate a catalog, and configure category and catalog item pages before you begin to create result sources. This is because you can then more easily test and verify how the different result sources apply to the different Search Web Parts that you have on the site.

建立結果來源Create a result source

您可以針對 Search Service 應用程式、網站集合或是網站建立結果來源。下表顯示在每一個層級建立結果來源所需的權限,以及結果來源可以使用的場合。You can create a result source for a Search service application, a site collection, or a site. The following table shows the permissions that are required to create a result source at each level, and where the result source can be used.

結果來源的層級與權限Levels and permissions for result sources

當您在此層級建立結果來源時When you create a result source at this level 您必須具備此權限You must have this permission 結果來源可使用於The result source can be used in
Search Service 應用程式Search service application
Search Service 應用程式管理員Search service application administrator
Web 應用程式中使用 Search Service 應用程式的所有網站集合All site collections in web applications that consume the Search service application
網站集合Site collection
網站集合管理員Site collection administrator
網站集合中的所有網站All sites in the site collection
網站Site
網站擁有人Site owner
該網站The site

建立結果來源To create a result source

  1. 根據您要建立結果來源的層級,執行下列其中一項操作:Depending on the level at which you want to create the result source, do one of the following:

    • 若要針對 Search Service 應用程式建立結果來源:To create a result source for a Search service application:
  2. 請確認執行此程序的使用者帳戶為否為 Search Service 應用程式管理員。Verify that the user account that performs this procedure is an administrator on the Search service application.

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

  4. 針對您要建立的結果來源,按一下 [Search Service 應用程式]。Click the Search service application for which you want to create a result source.

  5. 按一下 [Search service 應用程式,在 [快速啟動]、 [查詢與結果] 區段中的 [搜尋管理] 頁面上的 [結果來源]。On the Search Administration page for the Search service application, on the Quick Launch, in the Queries and Results section, click Result Sources.

    • 若要建立網站集合的結果來源:To create a result source for a site collection:
  6. 確認執行此程序的使用者帳戶為發佈網站集合的網站集合管理員。Verify that the user account that performs this procedure is a site collection administrator on the publishing site collection.

  7. 發佈的網站集合,在 [設定] 功能表上按一下 [網站設定]。On the publishing site collection, on the Settings menu, click Site Settings.

  8. 按一下 [網站設定] 頁面上的 [網站集合管理] 區段中的 [搜尋結果來源]。On the Site Settings page, in the Site Collection Administration section, click Search Result Sources.

    • 若要建立網站的結果來源:To create a result source for a site:
  9. 確認執行此程序的使用者帳戶為發佈網站上擁有人群組的成員。Verify that the user account that performs this procedure is a member of the Owners group on the publishing site.

  10. 在發佈網站的 [設定] 功能表上按一下 [網站設定]。On the publishing site, on the Settings menu, click Site Settings.

  11. 按一下 [網站設定] 頁面的 [搜尋] 區段中的 [結果來源]。On the Site Settings page, in the Search section, click Result Sources.

  12. 在 [管理結果來源] 頁面上按一下 [新增結果來源]。On the Manage Result Sources page, click New Result Source.

  13. 在 [新增結果來源] 頁面上的 [一般資訊] 區段中執行下列動作:On the Add Result Source page, in the General Information section, do the following:

  14. 在 [名稱] 方塊中輸入結果來源的名稱。In the Name box, type a name for the result source.

  15. 在 [描述] 方塊中輸入結果來源的描述。In the Description box, type a description of the result source.

  16. 在 [* * 通訊協定 * *] 區段中,選取下列通訊協定來擷取搜尋結果的其中一個:In the ** Protocol ** section, select one of the following protocols for retrieving search results:

    • 本機 SharePoint的預設通訊協定提供此 Search service 應用程式從搜尋索引的結果。Local SharePoint, the default protocol, provides results from the search index for this Search service application.

    • 遠端 SharePoint ] 提供其他伺服器陣列中的搜尋服務索引結果。Remote SharePoint provides results from the index of a search service in another farm.

      重要

      [!重要事項] 若要使用遠端 SharePoint 通訊協定,從某個 SharePoint Server 內部部署伺服器陣列的索引,取得另一個 SharePoint Server 內部部署伺服器陣列中的搜尋結果,您必須設定接收查詢的伺服器陣列會信任傳送查詢的伺服器陣列。如需如何執行此作業的資訊,請參閱<設定兩個 SharePoint Server 伺服器陣列之間的搜尋信任>。To use the Remote SharePoint protocol to get search results in one SharePoint Server on-premises farm from the index of another SharePoint Server on-premises farm, you must configure the farm that receives the queries to trust the farm that sends the queries. For information about how to do this, see Configure trust for search between two SharePoint Server farms.

    • [OpenSearch ] 提供來自使用 OpenSearch 1.0/1.1 通訊協定之搜尋引擎的結果。OpenSearch provides results from a search engine that uses the OpenSearch 1.0/1.1 protocol.

    • Exchange 通訊協定只可讓您探索 Exchange Server 2013 內容vides 來自 SharePoint Server 2016 eDiscovery Center 透過 Microsoft Exchange Server 2013 的結果。按一下 [使用自動探索有搜尋系統自動找到 Exchange Server 2013 端點或輸入要擷取的結果的 Exchange web 服務 URL — 例如https://contoso.com/ews/exchange.asmx。The Exchange protocol only enables you to discover Exchange Server 2013 contentvides results from Microsoft Exchange Server 2013 through a SharePoint Server 2016 eDiscovery Center. Click Use AutoDiscover to have the search system find an Exchange Server 2013 endpoint automatically, or type the URL of the Exchange web service to retrieve results from — for example, https://contoso.com/ews/exchange.asmx.

      注意

      Exchange 通訊協定只可讓您探索 Exchange Server 內容以及只能從 SharePoint Server eDiscovery Center。如需詳細資訊,請參閱Configure SharePoint Server 與 Exchange Server 之間的通訊。> 搜尋服務執行所在之電腦上必須安裝 Exchange Web Services Managed API。如需詳細資訊,請參閱 <選用軟體支援的 SharePoint Server 2016的 SharePoint Server 2016 的硬體和軟體需求The Exchange protocol only enables you to discover Exchange Server content, and only from a SharePoint Server eDiscovery Center. For more information, see Configure communication between SharePoint Server and Exchange Server. > The Exchange Web Services Managed API must be installed on the computer on which the search service is running. For more information, see Optional software supported in SharePoint Server 2016 in Hardware and software requirements for SharePoint Server 2016.

  17. 在 [類型] 區段中選取 [ SharePoint 搜尋結果] 來搜尋整個索引或人員搜尋結果] 以啟用限於人員搜尋的查詢處理。In the Type section, select SharePoint Search Results to search the whole index, or People Search Results to enable query processing that is specific to people search.

  18. 在 [查詢轉換] 欄位中,執行下列其中一項:In the Query Transform field, do one of the following:

    • 保留預設查詢轉換 ( searchTerms) 原狀。在此例中,查詢會改變自先前的轉換。Leave the default query transform ( searchTerms) as is. In this case, the query will be unchanged since the previous transform.

    • 在文字方塊中輸入不同的查詢轉換。Type a different query transform in the text box.

    • 透過執行下列操作,使用查詢產生器設定查詢轉換:Use the Query Builder to configure a query transform by doing the following:

  19. 按一下 [啟動查詢建立器]。Click Launch Query Builder.

  20. 在 [建立您的查詢] 對話方塊中,選擇性地建立查詢 」 所指定篩選、 排序及測試] 索引標籤上的下列表格所示。In the Build Your Query dialog box, optionally build the query by specifying filters, sorting, and testing on the tabs as shown in the following tables.

    • 在 [基礎] 索引標籤上On the BASICS tab
關鍵字篩選Keyword filter
您可以使用關鍵字篩選將預先定義的查詢變數新增至查詢轉換。您可以從下拉式清單中選取預先定義的查詢變數並再按一下 [新增關鍵字篩選將其新增至查詢。You can use keyword filters to add pre-defined query variables to the query transform. You can select pre-defined query variables from the drop-down list, and then add them to the query by clicking Add keyword filter.
如需查詢變數的概觀,請參閱<Query variables in SharePoint Server>。For an overview of query variables, see Query variables in SharePoint Server.
屬性篩選Property filter
您可以使用屬性篩選查詢內容的 managed 屬性已設定為可查詢搜尋結構描述中。You can use property filters to query the content of managed properties that are set to queryable in the search schema.
您可以從 [屬性篩選] 下拉式清單中選取的 managed 的屬性。按一下 [新增屬性篩選新增至查詢的篩選。You can select managed properties from the Property filter drop-down list. Click Add property filter to add the filter to the query.
  • 在 [排序] 索引標籤上On the SORTING tab
排序結果Sort results
在 [排序方式] 功能表中您可以從之 managed 屬性的設定為可排序的搜尋結構描述中,然後選取 [遞減排序] 或 [遞增清單中選取受管理的屬性。用來排序相關性,也就是使用排名模型中,選取 [排名]。您可以按一下 [新增排序層級指定搜尋結果的排序的第二層級屬性。In the Sort by menu, you can select a managed property from the list of managed properties that are set as sortable in the search schema, and then select Descending or Ascending. To sort by relevance, that is, to use a ranking model, select Rank. You can click Add sort level to specify a property for a secondary level of sorting for search results.
> [!NOTE]> 排序搜尋結果是區分大小寫。> [!NOTE]> Sorting of search results is case sensitive.
排名模型Ranking Model
如果您從 [排序依據] 清單選取排名,您可以選取要用來排序的排名模型。If you selected Rank from the Sort by list, you can select the ranking model to use for sorting.
動態排序Dynamic ordering
您可以按一下 [新增動態排序規則來指定其他排名新增滿足特定條件時變更結果區塊內的結果順序的規則。You can click Add dynamic ordering rule to specify additional ranking by adding rules that change the order of results within the result block when certain conditions are satisfied.
  • 在 [測試] 索引標籤上On the TEST tab
查詢文字Query text
您可以檢視最終的查詢文字,該文字是根據原始查詢範本、適用查詢規則以及變數值而得。You can view the final query text, which is based on the original query template, the applicable query rules, and the variable values.
按一下 [顯示更多] 以顯示本表以下資料列中的選項。Click Show more to display the options in the following rows of this table.
查詢範本Query template
您可以檢視的查詢定義在 [基礎] 索引標籤中,或在 [新增結果來源] 頁面上的 [查詢轉換] 區段中 [文字] 方塊中。You can view the query as it is defined in the BASICS tab or in the text box in the Query transform section on the Add Result Source page.
查詢範本變數Query template variables
您可以透過指定查詢變數以測試查詢範本。You can test the query template by specifying values for the query variables.
  1. 在 [新增結果來源] 頁面上 [認證資訊] 區段中選取您要使用者連接至結果來源的驗證類型。On the Add Result Source page, in the Credentials Information section, select the authentication type that you want for users to connect to the result source.

將結果來源設定為預設值Set a result source as default

您可以將任何結果來源設定為預設結果來源。將結果來源指定為預設值,可以使該項查詢在搜尋網頁組件中更容易編輯。舉例來說,當您將內容搜尋網頁組件新增至頁面時,網頁組件會自動使用預設結果來源。如需詳細資訊,請參閱<在 SharePoint Server 中設定搜尋網頁組件>。You can set any result source as the default result source. Specifying a result source as default can make it easier to edit the query in Search Web Parts. For example, when you add a Content Search Web Part to a page, the Web Part automatically uses the default result source. For more information, see Configure Search Web Parts in SharePoint Server.

將結果來源設定為預設值To set a result source as default

  1. 依設定結果來源所在的層級,執行下列清單中適當的程序。Perform the appropriate procedures in the following list depending on the level at which the result source was configured.

    • 如果該項結果來源建立於 Search Service 應用程式層級,請執行下列操作:If the result source was created at the Search service application level, do the following:
  2. 確認執行此程序的使用者帳戶為否為 Search Service 應用程式管理員。Verify that the user account that performs this procedure is an administrator for the Search service application.

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

  4. 按一下您要將其結果來源設為預設值的 Search Service 應用程式。Click the Search service application for which you want to set the result source as default.

  5. 按一下 [搜尋管理] 頁面上的 [查詢與結果] 區段中的 [結果來源]。On the Search Administration page, in the Queries and Results section, click Result Sources.

    • 如果結果來源位於網站集合層級,請執行下列操作:If the result source is at the site collection level, do the following:
  6. 確認執行此程序的使用者帳戶為發佈網站集合的網站集合管理員。Verify that the user account that performs this procedure is a site collection administrator on the publishing site collection.

  7. 發佈的網站集合,在 [設定] 功能表上按一下 [網站設定]。On the publishing site collection, on the Settings menu, click Site Settings.

  8. 按一下 [網站設定] 頁面上的 [網站集合管理] 區段中的 [搜尋結果來源]。On the Site Settings page, in the Site Collection Administration section, click Search Result Sources.

    • 如果該項結果來源位於網站層級,請執行下列操作:If the result source is at the site level, do the following:
  9. 確認執行此程序的使用者帳戶為發佈網站上擁有人群組的成員。Verify that the user account that performs this procedure is a member of the Owners group on the publishing site.

  10. 在發佈網站的 [設定] 功能表上按一下 [網站設定]。On the publishing site, on the Settings menu, click Site Settings.

  11. 按一下 [網站設定] 頁面的 [搜尋] 區段中的 [結果來源]。On the Site Settings page, in the Search section, click Result Sources.

  12. 在 [管理結果來源] 頁面上,指向您要設為預設值]、 按一下出現箭號,然後按一下 [設成預設值的結果來源。On the Manage Result Sources page, point to the result source that you want to set as default, click the arrow that appears, and then click Set as Default.

另請參閱See also

概念Concepts

Query variables in SharePoint ServerQuery variables in SharePoint Server

在 SharePoint Server 中設定搜尋網頁組件Configure Search Web Parts in SharePoint Server