So I was getting some unexpected behavior (as in just not working!) when I tried to apply sorting to people search from the peopleresults.aspx page through the query builder. I hadn’t had any issues sorting on my other result sources but people results were proving to be stubborn.
To reproduce, try going to your People search vertical which is generally peopleresults.aspx page, edit the people search results web part, and open up the sort section of the query builder. Try sorting on a field (FirstName or LastName would be a good one).
Create a new People Result Source
We take you through 10 best practices, considerations, and suggestions that can enrich your Microsoft Teams deployment and ensure both end-user adoption and engagement.
The solution is simple enough, instead of modifying the query on the page, create a new people result source.
1. Make a Copy of the existing result source
- Go to Site Settings –> Result Sources to access your site collection level result sources
- Give it a name, such as Sorted People Results
- Find the Query Transform and Launch the Query Builder
- Open the Sorting Tab and sort by whatever field you choose
- Leave everything else as is and save your new Result Source
2. Go back to your people results page, open the query builder, and change your result source to the one you just created. Your results should now be sorted!
Of course after I figured it out, I went and Binged/Googled the issue and found that someone had already asked. Guess I should’ve used search to solve the problem! TechThread