Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
This is more for me to find again in the future than a question as I've got stuck on this issue twice now!
When searching using Examine and sorting results by a field that is not a string (in my case an integer) you need to tell the query the field is an integer, and don't rely on the ExamineIndex.config definition being enough. Without this it will sort by the field but the string representation of the numbers. The new SortableField is what is required here.
var query = searchCriteria
.And().OrderBy(new SortableField("sortOrder", SortType.Int));
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted