THIS IS ARCHIVED DOCUMENTATION

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

In this article
In this article

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.

    Create a new template named Flight under the node /sitecore/Templates/User Defined | Coveo for Sitecore 4
  3. Add the following fields to the template:

    • Company (Single-Line-Text)

    • Price (Number)

      Price (Number) | Coveo for Sitecore 4
  4. Add a new Facet item named Company under the node /sitecore/System/Settings/Buckets/Facets.

    Add a new Facet item named Company under the node /sitecore/System/Settings/Buckets/Facets | Coveo for Sitecore 4
  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.

    Add three flight items in the folder having the same company but different prices | Coveo for Sitecore 4
    Add three flight items in the folder having the same company but different prices | Coveo for Sitecore 4
  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).

    Rebuild your master index through the Sitecore Control Panel or rebuild only the /sitecore/content/Flights tree through the…​ | Coveo for Sitecore 4
  8. Open your Coveo-powered search page in the page editor.

  9. Add a facet component to your page.

    Add a facet component to your page | Coveo for Sitecore 4
  10. Set the following properties for your facet component:

    • Title: Airlines

    • Field: Company

    • Computed field: Price

    • Computed field operation: Average

    • Computed field format: c0

      Computed field format: c0 | Coveo for Sitecore 4
  11. Save your page.

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

    Validate that the price average is displayed for each of your facet items | Coveo for Sitecore 4