Coveo Relevancy Sort

Implements the Coveo JavaScript Search Framework 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.

Insertion Location

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 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

Option name Description
Caption See caption component option
DOM unique Id Randomly generated HTML element id.
Additional data attributes Allows use of the Coveo JavaScript Search Framework 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

Recommended Articles