Coveo Relevancy Sort

Warning
Legacy feature

This article pertains to the Coveo Hive framework which is now in maintenance mode.

Choose one of Coveo’s more modern, lightweight, and responsive libraries for any future search interface development. See the search interface Implementation guide for more details.

Implements the Coveo JavaScript Search Framework Sort component with the sortCriteria component option set to relevancy. Clicking the Coveo Relevancy Sort search interface control allows the user to switch to search result sorting based on relevance.

Usage notes

  • When the Coveo Relevancy Sort search interface control is selected and a user performs a search query, the Coveo index computes and returns the score field value with the search result items. Therefore, no prior field indexing action is required to be able to use the Coveo Relevancy Sort rendering.

  • When a user changes the search results sorting option by clicking another Coveo Sort search interface control, this triggers a Search API call with the requested sortCriteria in the query parameters.

  • You can customize the CSS associated with this rendering.

Insertion location

Coveo Hive

The Coveo Relevancy Sort rendering is an Allowed Control in the following placeholder(s): Sorts

Example insertion sequence for the Coveo Relevancy Sort rendering.

Coveo Hive SXA

Coveo for Sitecore SXA rendering insertion locations aren’t limited by placeholder Allowed Controls. The Coveo Relevancy Sort rendering may therefore be inserted throughout the partial design, whether in Coveo for Sitecore or Sitecore placeholders.

Example insertion sequence for the Coveo Relevancy Sort rendering.

Data source options

The following table lists the available data source options for this rendering.

Option name Description

Caption

See the caption component option.

DOM unique ID

Randomly generated HTML element ID.

Additional data attributes

Allows use of the Coveo JavaScript Search Framework Sort component options that aren’t directly available in the data source.

Sample generated HTML and corresponding visual output

<div class="coveo-sort-container">
   <span id="coveo7b19ddfe"
   class="CoveoSort coveo-accessible-button coveo-accessible-button-pressed coveo-selected"
   data-caption="Relevance" data-prebind-sort-criteria="sortCriteriaResolver"
   data-sort-criteria="relevancy" data-sc-enable-both-sort-directions="false"
   data-applied-prebind="true" role="button" aria-label="Sort results by Relevance"
   tabindex="0">
      Relevance
   </span>
</div>
Relevance sort example | Coveo for Sitecore 5