Insert a Category Facet

Coveo for Sitecore 5 (February 2019)

Your Sitecore items sometimes follow a logical hierarchical structure in the Content Tree. In such circumstances, you might want to reflect this structure in a search interface facet and allow your website visitors to drill down in the hierarchy. This article provides you with the instructions on how to insert a Coveo Category Facet in a search page.

Coveo for Sitecore (April 1, 2020)

The Coveo Dynamic Hierarchical Facet, which incorporates the Dynamic Navigation Experience feature, is now recommended over the Coveo Category Facet.

The Coveo Dynamic Hierarchical Facet supports the same Sitecore Content Editor hierarchical structure and category field value format as the Coveo Category Facet.

Example

You have a commerce site with Sitecore product items for each of your catalog products. These Sitecore items are created in the following folder structure:

To create a Coveo Category Facet for these items

  1. In the Sitecore Content Editor, in your product item template, add a Multi-Line Text field called ParentCategories.
  2. For the GE1 product item, created off of the product item template, you would enter the following value in the ParentCategories field to list the paths to each of the GE item parent folders: Ecommerce;Ecommerce|Electrical Appliances;Ecommerce|Electrical Appliances|Refrigerators;Ecommerce|Electrical Appliances|Refrigerators|GE

    The semicolon (;) is the default multi-value separator in Coveo for Sitecore. You might have specified another symbol as your multi-value separator in the Coveo.SearchProvider.Custom.config file (see Changing the Separator of Multi-Value Fields).

  3. Publish your changes.
  4. Configure your ParentCategories field as a multi-value facet and rebuild your indexes (see Configuring a Field as a Multi-Value Facet).

  5. In the Sitecore Experience Editor, select the Facets component.

  6. Click Add here at the position you want to insert your Category Facet.
  7. In the Select a Rendering dialog, select Coveo Category Facet.
  8. In the Select the Associated Content dialog, select Create New Content to create a new data source for your Coveo Category Facet.
  9. Select your Coveo Category Facet.
  10. In the floating toolbar, select Edit the rendering’s data source. It should be the leftmost option in the toolbar.
  11. In the Basic Settings section, set values for the following fields:

    • Title: The value in this field becomes the facet caption.
    • Field: Use the Select Field link to select the target Sitecore field you configured as a multi-value facet in the first steps of this procedure.
    • Facet Name

  12. In the Navigation section, set the value of the FacetBasePath field to the path of your high-level categories parent folder, relative to the Home content tree item.

    You’re now ready to test your category facet.

What's Next for Me?