Contents
The default sort direction is descending. You may also use a formula that sorts by ascending value, for example, if the formula specifies a geographical distance. The following code example shows how to specify sort by formula with ascending sort order by using the Query object model.
By default, search results are sorted by relevance rank. This means that SharePoint places the most relevant results on top in the search result set. If you sort by rank, the results are always sorted in descending order. But you can change the sort order to ascending by using SortDirection ().
How to change the Order of search results?
But you can change the sort order to ascending by using SortDirection (). You can also influence the rank calculation in the query string, in one of two ways: By using the XRANK operator available in Keyword Query Language (KQL) syntax reference and FAST Query Language (FQL) syntax reference.
How to sort search results by managed properties?
You can apply a sort formula on the value of managed properties of type Integer, Decimal, and Datetime (). You must enable sorting for the specified managed property in the search schema. For more managed properties of type Decimal, the value is multiplied by 10^ (decimal digits) before being used in the formula evaluation.
Can a web part be sorted in alphabetical order?
By default, the documents order in the document library web part is the same like document library. As the document library is sorted by name in ascending, so the document in library is in alphabetical order. But if you modify the order in the document library, the web part will not change. You should re-add it to the home page.
How to change default sorting on document library?
It should take you to the edit view page, there should be a section called “Sort” make the changes you need and click save.