THIS IS ARCHIVED DOCUMENTATION

Performing Aggregation Operations on Facet Values Using the Coveo for Sitecore Legacy Search UI Framework

Coveo for Sitecore 4.1 (November 2018)

Computed values can be displayed for each facet item in Coveo for Sitecore. The computed values can either be the sum, the average, the minimum, or the maximum of a numeric field associated with the facet value. This tutorial demonstrates how to associate computed fields to a new facet.

Steps

  1. Open the Sitecore Content Editor.

  2. Create a new template named Flight under the node /sitecore/Templates/User Defined.

  3. Add the following fields to the template:

    • Company (Single-Line-Text)

    • Price (Number)

  4. Add a new Facet item named Company under the node /sitecore/System/Settings/Buckets/Facets.

  5. Add a folder Flights under the node /sitecore/Content

  6. Add three flight items in the folder, having the same company but different prices.

  7. Rebuild your master index through the Sitecore Control Panel or rebuild only the /sitecore/content/Flights tree through the Develop Toolbar (see Coveo for Sitecore Indexing Guide).

  8. Open your Coveo-powered search page in the page editor.

  9. Add a facet component to your page.

  10. Set the following properties for your facet component:

    • Title: Airlines

    • Field: Company

    • Computed field: Price

    • Computed field operation: Average

    • Computed field format: c0

  11. Save your page.

  12. Validate that the price average is displayed for each of your facet items.