Search results are by default sorted by relevance, given that a search query exists. By using the OrderBy, ThenBy, OrderByDescending and ThenByDescending methods it is possible to instead sort by a specific field.
client.Search<Article>() .OrderBy(x => x.PublicationDate) .ThenBy(x => x.Author.Name)
Sorting is supported on numerical types such as int and double, DateTime and strings.
Null values and SortMissing
By default documents with null values in a field on which the search results are being sorted on will be sorted first when using the OrderBy and ThenBy methods and last when using the OrderByDescending and ThenByDescending methods. For all types except strings this can be changed by supplying a second parameter of the SortMissing enum type.
client.Search<Article>() .OrderBy(x => x.PublicationDate, SortMissing.Last)