How to sort by publishing date ?
I have a question about sortCriteria parameter. How to sort by PublishDate or any field with DateTime field type in sitecore ? I tried the code below but no luck. args.queryBuilder.sortCriteria = "@(Model.ToCoveoFieldName("PublishDate", false)) descending";
Your suggestion would be much appreciated.
Did you make sure your Sitecore "PublishedDate" field has the isSortable="true" option in the field map before trying to sort on it (see Making a Sitecore field sortable)?
Try to set the option even if the documentation says date fields should be sortable by default and tell me if it helps.