在 SharePoint Server 中設定精簡器和多面向導覽Configure refiners and faceted navigation in SharePoint Server

摘要:了解如何將編目的屬性對應到可精簡搜尋的 managed 屬性,啟用 managed 的屬性作為精簡器,以及設定多面向導覽的精簡器。Summary: Learn how to map a crawled property to a refinable managed property, enable a managed property as a refiner, and configure refiners for faceted navigation.

您可將精簡器新增到網頁,幫助使用者快速瀏覽到特定內容。精簡器是以搜尋索引的 Managed 屬性為基礎。若要將 Managed 屬性當作精簡器使用,您必須啟用 Managed 屬性作為精簡器,或必須將編目屬性對應到當作精簡器啟用的 Managed 屬性。You can add refiners to a page to help users quickly browse to specific content. Refiners are based on managed properties from the search index. To use managed properties as refiners, the managed properties must be enabled as refiners, or crawled properties must be mapped to managed properties that are enabled as refiners.

瀏覽內容篩選已繫結至類別頁面的精簡器程序是多面向導覽。多面向導覽可讓您指定不同的精簡器的類別頁面、 甚至是在 [基礎] 頁面上顯示的類別不相同。如需類別頁面,請參閱Overview of 跨網站發佈的 SharePoint Server中的"類別頁面和目錄項目頁面"。Faceted navigation is the process of browsing for content by filtering on refiners that are tied to category pages. Faceted navigation lets you specify different refiners for category pages, even when the underlying page displaying the categories is the same. For information about category pages, see "Category pages and catalog item pages" in Overview of cross-site publishing in SharePoint Server.

重要

您可以將多層面導覽套用只有發佈網站使用SharePoint Server 中的受管理導覽的概觀,以及相關清單或文件庫的文件庫或清單作為目錄共用You can apply faceted navigation only to publishing sites that use Overview of managed navigation in SharePoint Server, and for lists or libraries that have been Share a library or list as a catalog.

開始之前Before you begin

規劃 SharePoint Server 2016 跨網站發佈網站的搜尋檢閱中 「 規劃精簡器和多面向導覽 」 的資訊。Review the information in "Plan refiners and faceted navigation" in Plan search for cross-site publishing sites in SharePoint Server 2016.

關於針對不同資料類型設定精簡器About configuring refiners for different data types

目錄編目時,SharePoint 伺服器會自動建立 managed 的屬性包含值的所有網站欄。這些自動建立 managed 的屬性使用的文字資料類型。若要確定使用數字、 貨幣、 整數、 及日期和時間資料類型的精簡器會顯示正確的格式,您可以執行下列其中一項動作:When a catalog is crawled, SharePoint Server automatically creates managed properties for all site columns that contain values. These automatically created managed properties use the Text data type. To make sure that refiners that use the Number, Currency, Integer, and Date and Time data types are displayed in the correct format, you can do one of the following:

  1. 使用對應到可精簡搜尋的 managed 屬性在 SharePoint 網站集合管理中將編目的屬性中所述的程序。網站集合管理員可以執行此程序。我們建議您所有的資料類型使用此程序。Use the procedure that is described in Map a crawled property to a refinable managed property in SharePoint site collection administration. This procedure can be performed by site collection administrators. We recommend that you use this procedure for all data types.

  2. 建立 managed 的屬性、 將類型代碼新增至屬性名稱,並啟用為精簡器。只可由系統管理員的 Search service 應用程式執行此程序。Create a managed property, add the type code to the property name, and then enable it as a refiner. This procedure can only be performed by an administrator of the Search service application.

  3. 將 JavaScript 新增到精簡器的顯示位置] 頁面上。如需詳細資訊,請參閱 <將 JavaScript 新增到頁面以便顯示正確的格式的精簡器Add JavaScript to the page where the refiners are displayed. For more information, see Add JavaScript to a page to display refiners in the correct format .

在 SharePoint 網站集合管理中將編目屬性對應到可精簡搜尋的 Managed 屬性Map a crawled property to a refinable managed property in SharePoint site collection administration

網站集合管理員可設定精簡器,因為搜尋結構描述有很多 Managed 屬性都已依預設啟用為精簡器。下表列出這些 Managed 屬性。網站集合管理員能夠在網頁上將這些 Managed 屬性當作精簡器使用前,必須將適當的編目屬性對應到已啟用為精簡器的 Managed 屬性。在字詞儲存管理中執行其他精簡器設定時,若要讓這些屬性操作起來更方便,您可為 Managed 屬性指定易懂的別名。Site collection administrators can configure refiners because the search schema has many managed properties that are enabled as refiners by default. These managed properties are listed in the following table. Before site collection administrators can use these managed properties as refiners on their web pages, they must map the appropriate crawled property to the managed property that is enabled as a refiner. To make it easier to work with these properties when doing additional refiner configuration in Term Store Management, you can specify a user-friendly alias name for the managed property.

如需依預設啟用為精簡器的 managed 屬性的概觀,請參閱的已啟用為精簡器預設的 Managed 屬性For an overview of managed properties that are enabled as refiners by default, see Managed properties that are enabled as refiners by default.

注意

此程序是在製作網站集合上執行。This procedure is performed on the authoring site collection.

若要將編目的屬性對應到可精簡搜尋的 managed 屬性To map a crawled property to a refinable managed property

  1. 確認執行此程序的使用者帳戶為製作網站集合的網站集合管理員。Verify that the user account that performs this procedure is a site collection administrator on the authoring site collection.

  2. 在製作網站集合] 按一下 [設定] 功能表上按一下 [網站設定]。On the authoring site collection, on the Settings menu, click Site settings.

  3. 在 [網站設定] 頁面上的 [網站集合管理] 區段中按一下 [搜尋結構描述On the Site Settings page, in the Site Collection Administration section, click Search Schema.

  4. 在 [ Managed 屬性] 頁面的 [在Managed 屬性] 篩選方塊中,輸入可精簡搜尋的 managed 屬性的名稱 — 例如 RefinableString00 — 然後按一下箭號。On the Managed Properties page, in the Managed property filter box, type the name of a refinable managed property — for example, RefinableString00 — and then click the arrow.

  5. 在 [屬性名稱] 欄中,按一下您想要編輯的可精簡搜尋的 managed 的屬性。In the Property Name column, click the refinable managed property that you want to edit.

  6. 若要指定可精簡搜尋的 managed 屬性時您在 [編輯 Managed 屬性] 頁面上設定多面向導覽的精簡器所使用的別名輸入易記名稱 [別名] 方塊中。To specify an alias of the refinable managed property to use when you configure refiners for faceted navigation, on the Edit Managed Property page, type a user-friendly name in the Alias box.

    重要

    使用資料的屬性輸入受管理的中繼資料、 別名必須包含型別程式碼、 owstaxId ,後面加上屬性名稱。例如,名為色彩使用受管理的中繼資料的資料類型的屬性,可精簡搜尋的 managed 屬性的別名必須是owstaxIdColorFor properties that use the data type Managed Metadata, the alias must consist of the type code, owstaxId , followed by the property name. For example, for a property named Color that uses the Managed Metadata data type, the alias for the refinable managed property must be owstaxIdColor .

  7. 在 [對應至編目屬性] 區段中,按一下 [新增對應]。In the Mappings to crawled properties section, click Add a Mapping.

  8. 在 [編目屬性選取項目] 對話方塊中,尋找您想要對應到可精簡搜尋的 managed 屬性] 清單中,或其搜尋方塊中,輸入編目屬性的名稱,然後按一下 [尋找編目的屬性。In the Crawled property selection dialog box, find the crawled property that you want to map to the refinable managed property in the list, or search for it by typing the name of the crawled property in the box, and then clicking Find.

    重要

    當您搜尋編目屬性時,您可能會發現兩個編目的屬性代表相同的內容。例如,網站欄類型名為色彩的文字將編目期間探索兩個編目屬性: ows_Colorows_q_TEXT_Color 。編目屬性的其中一個開頭ows_r<四信件的程式碼>ows_q<四字母代碼>,或ows_taxId會自動建立編目的屬性。當您選取編目的屬性對應到可精簡搜尋的 managed 屬性,請確定您不要將對應時自動建立編目屬性。但是,一律將編目的屬性對應ows_開頭。> 如需自動建立編目屬性的詳細資訊,請參閱SharePoint Server 中的 managed 的屬性會自動建立When you search for a crawled property, you may find two crawled properties that represent the same content. For example, a site column of type Text named Color will during crawl discover two crawled properties: ows_Color and ows_q_TEXT_Color . Crawled properties that begin with either ows_r<four letter code> , ows_q<four letter code> , or ows_taxId are automatically created crawled properties. When you select a crawled property to map to a refinable managed property, make sure that you don't map the automatically created crawled property. Instead, always map the crawled property that begins with ows_ . > For more information about automatically created crawled properties, see Automatically created managed properties in SharePoint Server.

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

  10. 在 [編輯 Managed 屬性] 頁面上按一下 [確定]On the Edit Managed Property page, click OK.

注意

若要在網頁組件或字詞庫管理中設定精簡器,您必須啟動包含可精簡搜尋的 managed 的屬性的內容來源的完整編目。如需詳細資訊,請參閱 <設定跨網站發佈的搜尋To configure refiners in Web Parts or in Term Store Management, you must start a full crawl of the content source that contains the refinable managed properties. For more information, see Configure search for cross-site publishing.

在 SharePoint 管理中心將自動建立的 Managed 屬性當作精簡器啟用Enable automatically created managed properties as refiners in SharePoint Central Administration

所有自動建立 managed 的屬性使用的文字資料類型。若要確定該正確的格式顯示精簡器,您應該僅啟用自動建立的 managed 的屬性作為精簡器如果它根據使用的文字、 受管理的中繼資料或個人或群組的資料類型的網站欄。其他資料類型,必須建立的 managed 的屬性、 將類型代碼新增至屬性名稱,並啟用為精簡器的 managed 的屬性。All automatically created managed properties use the Text data type. To make sure that the refiners are displayed in the correct format, you should only enable an automatically created managed property as a refiner if it is based on a site column that uses the data type Text, Managed Metadata, or Person or Group. For other data types, you must create a managed property, add the type code to the property name, and enable the managed property as a refiner.

如需自動建立的 managed 屬性的詳細資訊,請參閱SharePoint Server 中的 managed 的屬性會自動建立For more information about automatically created managed properties, see Automatically created managed properties in SharePoint Server.

若要啟用自動建立的 managed 的屬性作為精簡器To enable an automatically created managed property as a refiner

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

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

  3. 在 [管理服務應用程式] 頁面上,按一下您要啟用為精簡器的 managed 的屬性的 Search service 應用程式。On the Manage Service Applications page, click the Search service application in which you want to enable the managed property as a refiner.

  4. 在「搜尋管理」頁面的 [快速啟動] 中,按一下 [查詢與結果] 底下的 [搜尋結構描述]。On the Search Administration page, in the Quick Launch, under Queries and Results, click Search Schema.

  5. 在 [ Managed 屬性] 頁面的Managed 屬性] 篩選方塊中,輸入您想要做為精簡器,啟用 managed 屬性的名稱及 [箭號。On the Managed Properties page, in the Managed property filter box, type the name of the managed property that you want to enable as refiner, and then click the arrow.

  6. 在 [屬性名稱] 欄中,按一下您想要編輯的 managed 的屬性。In the Property Name column, click the managed property that you want to edit.

  7. 在 [編輯 Managed 屬性] 頁面上 [ Refinable ] 區段中選取 [ Yes-active ] 或 [ Yes-latent。如果您選取 [ Yes-latent],您可以切換精簡器至作用中稍後不必執行完整編目。On the Edit Managed Property page, in the Refinable section, select either Yes - active or Yes - latent. If you select Yes - latent, you can switch the refiner to active later without having to do a full crawl.

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

注意

若要在網頁組件或字詞庫管理中設定精簡器,您必須完成包含可精簡搜尋的 managed 的屬性的內容來源的完整編目。如需詳細資訊,請參閱 <設定跨網站發佈的搜尋To configure refiners in Web Parts or in Term Store Management, you must complete a full crawl of the content source that contains the refinable managed properties. For more information, see Configure search for cross-site publishing.

若要建立的 managed 的屬性、 將類型代碼新增至名稱,並啟用 managed 的屬性作為精簡器To create a managed property, add type code to the name, and enable a managed property as a refiner

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

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

  3. 在 [管理服務應用程式] 頁面上,按一下您要建立的 managed 的屬性的 Search service 應用程式。On the Manage Service Applications page, click the Search service application in which you want to create a managed property.

  4. 在「搜尋管理」頁面的 [快速啟動] 中,按一下 [查詢與結果] 底下的 [搜尋結構描述]。On the Search Administration page, in the Quick Launch, under Queries and Results, click Search Schema.

  5. 在 [ Managed 屬性] 頁面上按一下 [新增 Managed 屬性]。On the Managed Properties page, click New Managed Property.

  6. 在 [新增 Managed 屬性] 頁面上的屬性名稱] 方塊中,[名稱與描述] 區段中輸入新的 managed 屬性,後面接著適當的型別程式碼的名稱。如需類型代碼的概觀,請參閱類型代碼On the New Managed Property page, in the Property name box, in the Name and description section, type the name of the new managed property, followed by the appropriate type code. For an overview of type codes, see Type codes.

  7. 在 [類型] 區段中選取適當的資料類型。In the Type section, select the appropriate data type.

  8. 在 [主要特性] 區段中,設定下列選項:In the Main characteristics section, set the following selections:

    • 設為可查詢Queryable

    • Refinable: [Yes-active或是-潛伏Refinable: Yes - active or Yes - latent

      您也可以在此區段中指定其他設定。You can also specify additional settings in this section.

  9. 按一下 [對應至編目屬性] 區段中的 [新增對應]。In the Mappings to crawled properties section, click Add a mapping.

  10. 在 [編目屬性選取項目] 對話方塊中,尋找您想要對應的方塊中,輸入編目屬性的名稱,然後按一下 [尋找] 清單中,或其搜尋的 managed 屬性的編目的屬性。In the Crawled property selection dialog box, find the crawled property that you want to map to the managed property in the list, or search for it by typing the name of the crawled property in the box, and then clicking Find.

    重要

    當您搜尋編目屬性時,您可能會發現兩個編目的屬性代表相同的內容。例如,網站欄類型的日期和時間名為建立將編目期間探索兩個編目屬性: ows_Createdows_q_DATE_Created 。編目屬性的其中一個開頭ows_r<四信件的程式碼>、 ows_q<四字母代碼>ows_taxId會自動建立編目的屬性。當您選取要對應至 managed 屬性,請確定您未對應編目的屬性時自動建立編目屬性。但是,一律將編目的屬性對應開頭為ows_。When you search for a crawled property, you may find two crawled properties that represent the same content. For example, a site column of type Date and Time named Created will during crawl discover two crawled properties: ows_Created and ows_q_DATE_Created . Crawled properties that begin with either ows_r<four letter code>, ows_q<four letter code> or ows_taxId are automatically created crawled properties. When you select a crawled property to map to a managed property, make sure that you don't map the automatically created crawled property. Instead, always map the crawled property that begins with ows_.

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

注意

若要在網頁組件或字詞庫管理中設定精簡器,您必須完成包含可精簡搜尋的 managed 的屬性的內容來源的完整編目。如需詳細資訊,請參閱 <設定跨網站發佈的搜尋To configure refiners in Web Parts or in Term Store Management, you must complete a full crawl of the content source that contains the refinable managed properties. For more information, see Configure search for cross-site publishing.

設定多層面導覽的精簡器Configure refiners for faceted navigation

執行本節程序前,請確認下列事項:Before you start the procedures in this section, verify the following:

啟用多層面導覽的字詞組Enable a term set for faceted navigation

要設定多層面導覽的精簡器,您必須先啟用多層面導覽的相關字詞組。此程序是在製作網站集合上執行。To configure refiners for faceted navigation, you must first enable the relevant term set for faceted navigation. This procedure is performed on the authoring site collection.

若要啟用設定多面向導覽的字詞To enable a term set for faceted navigation

  1. 確認執行此程序的使用者帳戶是製作網站集合的設計者 SharePoint 群組成員。Verify that the user account that performs this procedure is a member of the Designers SharePoint group on the authoring site collection.

  2. 在製作網站集合] 按一下 [設定] 功能表上按一下 [網站設定]。On the authoring site collection, on the Settings menu, click Site settings.

  3. 按一下 [網站設定] 頁面上的 [網站管理] 區段中的 [字詞儲存管理]。On the Site Settings page, in the Site Administration section, click Term store management.

  4. 在 [分類法字詞庫] 區段中,按一下以選取想要啟用多層面導覽的字詞組。In the TAXONOMY TERM STORE section, click to select the term set that you want to enable for faceted navigation.

  5. 按一下 [預期的用途] 索引標籤,然後選取 [使用此顯示多層面導覽字詞組Click the INTENDED USE tab, and then select Use this Term Set for Faceted Navigation.

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

將精簡器新增到字詞組Add refiners to a term set

設定多層面導覽的精簡器時,您可以將精簡器新增到字詞組的所有字詞,或是字詞組的特定字詞。此程序是在製作網站集合上執行。When configuring refiners for faceted navigation, you can add refiners to all terms in a term set or to specific terms in a term set. This procedure is performed on the authoring site collection.

若要將精簡器新增到字詞組中的所有字詞To add refiners to all terms in a term set

  1. 確認執行此程序的使用者帳戶是製作網站集合的設計者 SharePoint 群組成員。Verify that the user account that performs this procedure is a member of the Designers SharePoint group on the authoring site collection.

  2. 在製作網站集合] 按一下 [設定] 功能表上按一下 [網站設定]。On the authoring site collection, on the Settings menu, click Site settings.

  3. 按一下 [網站設定] 頁面上的 [網站管理] 區段中的 [字詞儲存管理]。On the Site Settings page, in the Site Administration section, click Term store management.

  4. 在 [分類法字詞庫] 區段中,按一下 [已啟用的多層面導覽的字詞組。In the TAXONOMY TERM STORE section, click the term set that you have enabled for faceted navigation.

  5. [多層面導覽] 索引標籤和 [自訂精簡器Click the FACETED NAVIGATION tab, and then click Customize refiners.

  6. 在 [精簡搜尋設定] 頁面中可用的精簡器] 區段中,使用] 按鈕以選取的精簡器應新增至字詞組,並以指定您想要精簡器新增到出現的順序。如果您有指定別名為可精簡搜尋的 managed 屬性,這個別名會顯示在 [設定] 區段中。On the Refinement Configuration page, in the Available refiners section, use the buttons to select which refiners should be added to the term set, and also to specify the order in which you want the refiners to appear. If you have specified an alias for a refinable managed property, this alias is displayed in the Configuration section.

  7. 在 [設定] 區段中指定每個精簡器顯示的方式。In the Configuration for section, specify how you want each refiner to appear.

  8. 按一下[確定]以關閉 [精簡搜尋設定] 頁面] 和 [儲存Click OK to close the Refinement Configuration page, and then click Save.

    若要將精簡器新增到字詞組中的特定字詞To add refiners to specific terms in a term set

  9. 確認執行此程序的使用者帳戶是製作網站集合的設計者 SharePoint 群組成員。Verify that the user account that performs this procedure is a member of the Designers SharePoint group on the authoring site collection.

  10. 在製作網站集合] 按一下 [設定] 功能表上按一下 [網站設定]。On the authoring site collection, on the Settings menu, click Site settings.

  11. 按一下 [網站設定] 頁面上的 [網站管理] 區段中的 [字詞儲存管理]。On the Site Settings page, in the Site Administration section, click Term store management.

  12. 在 [分類法字詞庫] 區段中,按一下您已啟用的多層面導覽的字詞組和 [您要新增特定字詞精簡器的字詞。In the TAXONOMY TERM STORE section, click the term set that you have enabled for faceted navigation, and then click the term to which you want to add term-specific refiners.

  13. 按一下 [多層面導覽] 索引標籤和 [停止繼承Click the FACETED NAVIGATION tab, and then click Stop inheriting.

  14. [多層面導覽] 索引標籤] 和 [自訂精簡器Click FACETED NAVIGATION tab, and then click Customize refiners.

  15. 在 [精簡搜尋設定] 頁面中可用的精簡器] 區段中,使用] 按鈕以選取的精簡器應新增至字詞組,並以指定您想要精簡器新增到出現的順序。如果您有指定別名為可精簡搜尋的 managed 屬性,這個別名會顯示在 [設定] 區段中。On the Refinement Configuration page, in the Available refiners section, use the buttons to select which refiners should be added to the term set, and also to specify the order in which you want the refiners to appear. If you have specified an alias for a refinable managed property, this alias is displayed in the Configuration section.

  16. 在 [設定] 區段中指定每個精簡器顯示的方式。In the Configuration for section, specify how you want each refiner to appear.

  17. 按一下[確定]以關閉 [精簡搜尋設定] 頁面] 和 [儲存Click OK to close the Refinement Configuration page, and then click Save.

設定精簡器值的間隔Set intervals for refiner values

對於內含數值的精簡器,您可依不同間隔顯示數值。例如若您要使用者根據價格進行精簡搜尋,指定不同的價格範圍,就會比利用不同精簡器顯示所有可用的價格來得實用。此程序是在製作網站集合上執行。For refiners that contain numeric values, you can present the numeric values within different intervals. For example, if you want end-users to be able to refine based on price, it would be useful to specify different price ranges instead of showing all available prices as separate refiners. This procedure is performed in the authoring site collection.

設定精簡器值的範圍To set ranges for refiner values

  1. 將精簡器新增到字詞組如本文稍早的將精簡器新增到字詞組中所述。Add refiners to a term set as described in Add refiners to a term set earlier in this article.

  2. 按一下 [精簡搜尋設定] 頁面上的 [選取的精簡器] 區段中的 [您想要設定的範圍的精簡器]。On the Refinement Configuration page, in the Selected refiners section, click the refiner that you want to set ranges for.

  3. [設定] 區段中的 [間隔] 中,選取 [自訂],然後輸入範圍臨界值] 方塊中。In the Configuration for section, for Intervals, select Custom, and then type the ranges in the Thresholds box.

  4. 按一下[確定]以關閉 [精簡搜尋設定] 頁面] 和 [儲存Click OK to close the Refinement Configuration page, and then click Save.

其他步驟Additional steps

您必須將精簡搜尋面板網頁組件新增至您想要精簡器新增到出現頁面] 索引標籤上顯示精簡器。如需詳細資訊,請參閱 < Configure Search Web Parts in SharePoint ServerTo show refiners on a page, you must add a Refinement Panel Web Part to the page where you want the refiners to appear. For more information, see Configure Search Web Parts in SharePoint Server.

將 JavaScript 新增到頁面以便用正確的格式顯示精簡器Add JavaScript to a page to display refiners in the correct format

若要確定使用數字、 貨幣、 整數、 及日期和時間資料類型的精簡器會顯示正確的格式,您可以將 JavaScript 新增到精簡器的顯示位置] 頁面上。您可以將 JavaScript 新增新增內容編輯器網頁組件,您接著隱藏不會顯示在頁面。To make sure that refiners that use the Number, Currency, Integer, and Date and Time data types are displayed in the correct format, you can add JavaScript to the page where the refiners are displayed. You can add the JavaScript by adding a Content Editor Web Part, which you then hide from being displayed on the page.

請注意根據您所使用的預設顯示範本、 Filter_Default或其他顯示範本精簡搜尋網頁組件中的兩種方法。Note that there are two methods depending on whether you are using the default display template, Filter_Default, or another display template in your Refinement Web Part.

若要將 JavaScript 新增到頁面以便正確的格式顯示精簡器時所使用的預設顯示範本To add JavaScript to a page to display refiners in the correct format when you are using the default display template

  1. 確認執行此程序的使用者帳戶為發佈網站集合上的 Designers SharePoint 群組成員。Verify that the user account that performs this procedure is a member of the Designers SharePoint group on the publishing site collection.

  2. 瀏覽至顯示精簡器的頁面。Browse to the page where the refiners are displayed.

  3. 按一下 [設定] 功能表及 [編輯] 頁面Click the Settings menu, and then click Edit page.

  4. 在網頁組件區域中,按一下 [新增網頁組件]。In a Web Part Zone, click Add a Web Part.

  5. 在 [類別] 清單中,按一下 [媒體及內容In the Categories list, click Media and Content.

  6. 在 [組件] 清單中,按一下 [內容編輯器] 和 [新增In the Parts list, click Content Editor, and then click Add.

  7. 網頁組件中按一下 [按一下此處新增內容,並輸入下列兩個程式碼字串的其中一個:In the Web Part, click Click here to add new content, and type one of the following two code strings:

    # To ensure correct refiner formatting by using type code:
    Srch.ValueInfo.overrideRenderingForProperty( "<ManagedPropertyName>", "Property<TypeCode>" );
    # To ensure correct refiner formatting by using a managed properties that is enabled as a refiner by default:
    Srch.ValueInfo.overrideRenderingForProperty("<ManagedPropertyName>", "<DefaultRefinableManagedProperty>");
    

    其中:Where:

    • * <ManagedPropertyName>是已啟用為精簡器,例如CreatedOWSDATE之 managed 屬性的名稱。<ManagedPropertyName>* is the name of the managed property that is enabled as a refiner, for example CreatedOWSDATE .

    • 會指出資料類型,例如OWSDATE七個字母的程式碼。如需類型代碼的概觀,請參閱類型代碼 is a seven letter code indicating the data type, for example OWSDATE . For an overview of type codes, see Type codes.

    • 會根據預設,例如RefinableDate00啟用為精簡器的 managed 屬性的名稱。如需依預設啟用為精簡器的 managed 屬性的概觀,請參閱的已啟用為精簡器預設的 Managed 屬性 is the name of a managed property that is enabled as a refiner by default, for example RefinableDate00 . For an overview of managed properties that are enabled as refiners by default, see Managed properties that are enabled as refiners by default.

  8. 網頁組件中按一下內容編輯器網頁組件功能表]箭頭,然後再按一下 [編輯網頁組件In the Web Part, click the Content Editor Web Part Menu arrow, and then click Edit Web Part.

  9. 在 [網頁組件] 工具窗格中,依序展開 [版面配置] 區段,然後選取隱藏] 核取方塊。In the Web Part tool pane, expand the Layout section, and then select the check box Hidden.

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

    若要將 JavaScript 新增到頁面以便正確的格式顯示精簡器時您未使用的預設顯示範本To add JavaScript to a page to display refiners in the correct format when you are not using the default display template

  11. 確認執行此程序的使用者帳戶為發佈網站集合上的 Designers SharePoint 群組成員。Verify that the user account that performs this procedure is a member of the Designers SharePoint group on the publishing site collection.

  12. 瀏覽至顯示精簡器的頁面。Browse to the page where the refiners are displayed.

  13. 按一下 [設定] 功能表及 [編輯] 頁面Click the Settings menu, and then click Edit page.

  14. 在網頁組件區域中,按一下 [新增網頁組件]。In a Web Part Zone, click Add a Web Part.

  15. 在 [類別] 清單中,按一下 [媒體及內容In the Categories list, click Media and Content.

  16. 在 [組件] 清單中,按一下 [內容編輯器] 和 [新增In the Parts list, click Content Editor, and then click Add.

  17. 在網頁組件] 按一下 [按一下此處新增內容、,再輸入下列代碼字串:In the Web Part, click Click here to add new content, and then type the following code strings:

    # To ensure correct refiner formatting by using type code:
    Srch.ValueInfo.overrideRefinementTemplateForProperty("<ManagedPropertyName>", "Property<TypeCode>", "~sitecollection/<PathToDisplayTemplate>" );
    # To ensure correct refiner formatting by using a managed properties that is enabled as a refiner by default:
    Srch.ValueInfo.overrideRefinementTemplateForProperty("<ManagedPropertyName>", "<DefaultRefinableManagedProperty>", "~sitecollection/<PathToDisplayTemplate>" );
    

    其中:Where:

    • * <ManagedPropertyName>是已啟用為精簡器,例如CreatedOWSDATE之 managed 屬性的名稱。<ManagedPropertyName>* is the name of the managed property that is enabled as a refiner, for example CreatedOWSDATE .

    • 會指出資料類型,例如OWSDATE七個字母的程式碼。如需類型代碼的概觀,請參閱類型代碼 is a seven letter code indicating the data type, for example OWSDATE . For an overview of type codes, see Type codes.

    • 會根據預設,例如RefinableDate00啟用為精簡器的 managed 屬性的名稱。如需依預設啟用為精簡器的 managed 屬性的概觀,請參閱的已啟用為精簡器預設的 Managed 屬性 is the name of a managed property that is enabled as a refiner by default, for example RefinableDate00 . For an overview of managed properties that are enabled as refiners by default, see Managed properties that are enabled as refiners by default.

    • * <PathToDisplayTemplate>是要在精簡搜尋網頁組件,例如catalogs\masterpage\Display Templates\Filters\MyDisplayTemplate.js中使用之顯示範本的路徑。<PathToDisplayTemplate>* is the path of the display template that you are using in the Refinement Web Part, for example catalogs\masterpage\Display Templates\Filters\MyDisplayTemplate.js .

  18. 網頁組件中按一下內容編輯器網頁組件功能表]箭頭,然後再按一下 [編輯網頁組件In the Web Part, click the Content Editor Web Part Menu arrow, and then click Edit Web Part.

  19. 在 [網頁組件] 工具窗格中,依序展開 [版面配置] 區段,然後選取隱藏] 核取方塊。In the Web Part tool pane, expand the Layout section, and then select the check box Hidden.

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

參考表格Reference tables

預設已啟用為精簡器的 Managed 屬性Managed properties that are enabled as refiners by default


Managed 屬性名稱Managed property name 對應的資料類型。Data type for mapping.
RefinableDate00 - RefinableDate19RefinableDate00 - RefinableDate19
值包含日期。Values contain dates.
RefinableDecimal00 - RefinableDecimal09RefinableDecimal00 - RefinableDecimal09
值包含數字,最多可到小數點三位。Values contain numbers with maximum three decimals.
RefinableDouble00 - RefinableDouble09RefinableDouble00 - RefinableDouble09
值包含數字,可到小數點三位以上。Values contain numbers with more than three decimals.
RefinableInt00 - RefinableInt49RefinableInt00 - RefinableInt49
值為整數。Values are whole numbers.
RefinableString00 - RefinableString99RefinableString00 - RefinableString99
值為字串。這包含使用「文字」、「個人或群組」、「Managed 中繼資料」、「選擇」和「是/否」資料類型的值Values are strings. This includes values that use the data type Text, Person or Group, Managed Metadata, Choice and Yes/No

類型代碼Type codes

網站欄類型Site column type 類型代碼Type code 含類型代碼的 managed 的屬性名稱範例Example of managed property name with type code
數字Number
OWSNMBROWSNMBR
ManagedPropertyNameOWSNMBRManagedPropertyNameOWSNMBR
貨幣Currency
OWSCURROWSCURR
ManagedPropertyNameOWSCURRManagedPropertyNameOWSCURR
日期及時間Date and Time
OWSDATEOWSDATE
ManagedPropertyNameOWSDATEManagedPropertyNameOWSDATE
整數*Integer*
OWSINTGOWSINTG
ManagedPropertyNameOWSINTGManagedPropertyNameOWSINTG

*無法透過使用者介面建立欄。*Column creation not available through user interface.

另請參閱See also

概念Concepts

在 SharePoint Server 中自動建立 managed 的屬性Automatically created managed properties in SharePoint Server

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

其他資源Other Resources

部落格文章: 設定多面向導覽的精簡器Blog post: Configure refiners for faceted navigation

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