Coveo provides lot of tools and places where you could provide a sort mechanism. First things first, sort is the most important piece that goes with listing. If the listing of search results that you are showing to end user are not sorted per either business drive or more power to user where the user could actually select how he/she wants to sort their results is the key for the user to be able to find what they are looking for.
- Firstly define which field either sitecore or computed field you are going to use as a sort field.
- Note that OOTB, not all fields are sortable and you will need to configure and ensure that the field you are going to base the sort on is Coveo sortable. For example – string fields are not inherently sortable while number fields are.
- If the field you decided as sort field is not inherently sortable, configure it per directions listed here by Coveo documentation and rebuild your indexes.
https://developers.coveo.com/display/public/SitecoreV4/Making+a+Sitecore+Field+Sortable - After this step, always do a sanity check on admin tool that this field has a checkbox for sortable.
- Default Sort Type – Field | Date | Relevancy – I found Field and Date to be extremely useful
- Default Sort Direction – Ascending | Descending
- Default Sort Field – You have a pick list provided by Coveo which is a searchbox where you can type and find the sortable field you are looking for. We are using December 2016 version of Coveo which has an active bug, so, we had to use GUID as a workaround instead of using field picker. See an example on the screenshot below
After you pick everything coveo is expecting, give it a spin – Go to the page where this rendering exists and check what is happening on the query request. You should see the below two populate with the field you picked and direction you mentioned on default sort order. If you do not see this then the sort would not be working and you will have to debug further. Couple times, it is due to presentation being overridden, so try resetting it before you panic. 😱