階段 16: 新增分類精簡搜尋面板網頁組件至 SharePoint Server 發佈網站Stage 16: Add a Taxonomy Refinement Panel Web Part to a publishing site in SharePoint Server

摘要:了解如何將分類精簡搜尋面板網頁組件新增至 SharePoint Server 2016 的發佈網站。Summary: Learn how to add a taxonomy refinement panel web part to a publishing site 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

階段 15: 多面向導覽的精簡器新增至 SharePoint server 發佈網站清楚如何將多層面導覽的精簡器新增至發佈網站。藉由使用特定類別的精簡器,訪客可以輕鬆地尋找所要尋找的產品。但是,訪客無法輕鬆地查看特定類別內不同的子類別。Stage 15: Add refiners for faceted navigation to a publishing site in SharePoint Server explained how to add refiners for faceted navigation to a publishing site. By using category-specific refiners, visitors can easily find the product they are looking for. But, visitors can't easily see the different subcategories inside a particular category.

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

啟動階段 16Start stage 16

這一系列,整個時的新功能已導入,我們便會由解釋功能啟動,然後發生使用它的程序。在此階段中,我們將翻轉順序,因為它會更輕鬆地說明新將要使用網頁組件的螢幕擷取畫面。Throughout this series, when a new feature was introduced, we started by explaining the feature, and then went on to the procedures for using it. In this stage, we'll flip the sequence, because it will be easier to explain what's going on by using screen shots of the Web Part.

如何新增分類精簡搜尋面板網頁組件至頁面How to add a Taxonomy Refinement Panel Web Part to a page

瀏覽至您要新增網頁組件頁面。在我們的案例中,我們瀏覽至 「 相機 」。Browse to the page where you want to add the Web Part. In our scenario, let's browse to "Cameras."

  1. 按一下 [設定] 功能表,然後選取 [編輯頁面]Click the Settings menu, and then select Edit Page.

  2. 在您要新增網頁組件網頁組件區域,按一下 [新增網頁組件In the Web Part Zone where you want to add the Web Part, click Add a Web Part.

  3. 在 [類別] 清單中,按一下 [搜尋]。In the Categories list, click Search.

  4. 在 [組件] 清單中,按一下 [分類精簡搜尋面板] 和 [新增In the Parts list, click Taxonomy Refinement Panel, and then click Add.

  5. 儲存網頁。Save the page.

這是所有沒有它 !無須執行任何設定,會顯示 「 相機 」 下的子類別。也請注意會自動顯示精簡器計數。That's all there is to it! Without having to do any configuration, the sub-categories under "Cameras" are displayed. Also notice that refiner counts are automatically displayed.

已新增網頁組件

如果我們瀏覽至 「 音訊 」、 音訊子類別會顯示與計數。If we browse to "Audio," the Audio subcategories are displayed with counts.

音訊子類別

現在我們要探討"神奇地"顯示這些子類別的方式。Now let's look at how these sub-categories "magically" appear.

分類精簡搜尋面板網頁組件的相關About the Taxonomy Refinement Panel Web Part

讓我們開始進行此網頁組件的定義: 分類精簡搜尋面板網頁組件來篩選搜尋結果相關聯的搜尋網頁組件,可顯示目前的導覽字詞為基礎的精簡器。例如,在我們的案例網頁組件中顯示的子類別的 「 音訊"和"Computer"的子類別。Let's start with a definition of this Web Part: The Taxonomy Refinement Panel Web Part filters search results from an associated Search Web Part, which show refiners based on the current navigation term. For example, in our case the Web Part showed the sub-categories of "Audio" and sub-categories of "Computer".

分類精簡搜尋網頁組件正確運作,有兩個條件必須考量的:For the Taxonomy Refinement Web Part to work correctly, there are two conditions that have to be considered:

  1. 分類精簡搜尋網頁組件必須與其他搜尋網頁組件新增至頁面相關聯。The Taxonomy Refinement Web Part must be associated with another Search Web Part on the page that it is added to.

  2. 分類精簡搜尋網頁組件必須與 managed 屬性代表網站的受管理的導覽相關聯。The Taxonomy Refinement Web Part must be associated with the managed property that represents the managed navigation of the site.

此時之數列中,您可能已經知道,但只在您沒有的案例,我們將說明我們 Contoso 案例的內容中它。At this point in the series, you probably already knew this, but just in case that you didn't, we'll explain it within the context of our Contoso scenario.

讓我們開始使用第一個條件。Let's start with the first condition.

不同內容搜尋網頁組件中,於 [分類精簡搜尋網頁組件不包含在查詢。因為它不會查詢的內容,所以有著接收來自其他地方以顯示內容的搜尋結果。Unlike the Content Search Web Part, the Taxonomy Refinement Web Part doesn't contain a query. Because it doesn't query for content, it has to receive search results from elsewhere to display content.

在下列螢幕擷取畫面,分類精簡搜尋面板網頁組件會顯示在預設的編輯模式。在網頁組件工具窗格中,在 [查詢] 區段中精簡搜尋目標設為內容搜尋-預設值In the following screen shot, the Taxonomy Refinement Panel Web Part is shown in the default edit mode. In the Web Part Tool Pane, in the Query section, Refinement Target is set to Content Search - Default.

精簡搜尋目標

這個設定表示內容搜尋網頁組件所傳回的搜尋結果用做為輸入時分類精簡搜尋面板網頁組件。This configuration means that search results returned by the Content Search Web Part will be used as input by the Taxonomy Refinement Panel Web Part.

取出,可達到的第一個條件 !Check it out, first condition achieved!

現在的第二個條件: [分類精簡搜尋網頁組件必須與 managed 屬性代表網站的受管理的導覽相關聯。Now for the second condition: The Taxonomy Refinement Web Part must be associated with the managed property that represents the managed navigation of the site.

請記得:Remember:

  • 受管理的導覽是網站導覽字詞組所定義。Managed navigation is site navigation as defined by a term set.

  • 字詞組會對應至網站欄。The term set is mapped to a site column.

  • 在編目期間網站欄被表示做為受管理屬性。During crawl, the site column is represented as a managed property.

分類精簡搜尋面板網頁組件] 工具窗格的 [查詢] 區段中的精簡器設為owstaxIdProductCatalogItemCategoryIn the Taxonomy Refinement Panel Web Part tool pane, in the Query section, Refiner is set to owstaxIdProductCatalogItemCategory.

精簡器

若要將說明owstaxIdProductCatalogItemCategory需要後追蹤的位元:To explain owstaxIdProductCatalogItemCategory requires a bit of back-tracking:

取出,可達到的第二個條件 !Check it out, second condition achieved!

我們摘要說明:Let's summarize:

  1. 訪客瀏覽至 「 相機 」。A visitor browses to "Cameras."

  2. 在 [類別] 頁面上的 CSWP 自動發出查詢時的目錄項目與"照相機"或"照相機,"的所有子項目,並顯示此網頁組件中。The CSWP on the category page automatically issues a query for catalog items that are tagged with "Cameras" or any children of "Cameras," and displays this in the Web Part.

  3. 分類精簡搜尋面板網頁組件會使用 CSWP 的搜尋結果。而不顯示個別目錄項目,它會顯示搜尋結果所隸屬的類別為精簡器值的範例"數位相機"或"攝影機"。The Taxonomy Refinement Panel Web Part uses the search result from the CSWP. Instead of displaying individual catalog items, it displays the categories to which the search results belong as refiner values, for example "Digital cameras" or "Camcorders."

很酷吧但何謂分類精簡搜尋面板網頁組件更其帳戶舊的查詢或訪客可能會對時顯示其精簡器的限制。例如,我們 Contoso 網站上,如果訪客 」 照相機"瀏覽並選取Fabrikam做為 BRAND 精簡器分類精簡搜尋面板網頁組件會考慮這個精簡器選取項目時顯示其精簡器值。That's very cool, but what makes the Taxonomy Refinement Panel Web Part even cooler is that it accounts for previous queries or refinements that a visitor might have made when showing its refiners. For example, on our Contoso site, if a visitor browses to "Cameras" and selects Fabrikam as the BRAND refiner, the Taxonomy Refinement Panel Web Part considers this refiner selection when displaying its refiner values.

相機 Fabrikam 精簡器

以訪客這使得因為他們可以立即查看哪些子類別具有Fabrikam攝影機產品,不必反覆按一下產品真正便利的瀏覽。To visitors, this makes browsing for products really convenient, because they can immediately see which sub-categories have Fabrikam camera products, without having to click back and forth.

如此,會是所有的這一系列。若您要設定您的網站,我們希望您將在此系列中進行適時利用所述的功能。So, that was all for this series. If you are setting up your own site, we hope you'll make good use of the features that are described in this series.