Change the document sort criteria

To enable the Sort control which enables changing the document sort criteria add the following snippet to the appropriate SmartHub HTML page (such as Index.html or Results.html). For information on updating custom SmartHub pages, see Use the UI Editor.

<div class="coveo-sort-section">    
    <span class="CoveoSort" data-sort-criteria="relevancy" data-caption="Relevance"></span>    
    <span class="CoveoSort" data-sort-criteria="date descending,date ascending" data-caption="Date"></span>    
    <span class="CoveoSort" data-sort-criteria="@WilsonsScore descending,@WilsonsScore ascending"  data-caption="Rating"></span>
</div>

Each CoveoSort enables a different sort criteria. You can add or remove CoveoSort spans for any property that is sortable in the search index.