Sorting people search results
Hi
We tried to sort the PeopleSearch Results by LastName and then by FirstName using the Query Designer.
In the preview everything works fine, buth when we save the web part settings and do a seearch on the people results page, the results are not sorted as excpected.
Query Sorting, (sorting as expected in preview)

People results page using the settings above:

Not properly sorted
Does anybody have an idea?
Thanks,
Stephan
December 17th, 2012 2:10pm
Did you try creating a new result source with the query sorting you want? Then telling the search results web part to use it?
January 30th, 2013 10:16am
The LsstName and FirstName managed properties are not marked as sortable by default. Go to the search schema, mark them as sortable. Then do a full crawl. It will work after that.
Scot
February 7th, 2013 4:15pm
The LsstName and FirstName managed properties are not marked as sortable by default. Go to the search schema, mark them as sortable. Then do a full crawl. It will work after that.
Scot
Hi Scot
I already did that but this did not help.
February 7th, 2013 4:53pm
Did you do a full crawl after that?
Scot
February 7th, 2013 6:01pm
Yes, inclduing a index reset
February 7th, 2013 6:02pm
Wow! I was able to reproduce your problem. There seems to be no way to get the sorting to work correctly in the search results. I have been able to sort the results correctly using either a) Content by Search part or b) an App issuing a query through
the API.
I think you are going to have to replace the OOB people search page with a custom solution based on either the Content by Search part or an app.
I have an Employee Directory app available on my CodePlex project here.
http://apps.codeplex.com/releases/view/91377
Scot
February 7th, 2013 7:34pm
Hi Scot
Thanks for your studies. I'll implement a workaround and hope that the issue gets fixed with the next release.
Stephan
February 7th, 2013 7:40pm
Try to modify the sorting order in the result source instead:
- Go to Search Administration in Central Administration.
- Click on Result Sources under the Queries and Results section.
- Edit a copy of Local People Results.
- Click the Launch Query Builder button and specify your desired sorting order there.
- Save and configure your web part to use the new result source.
-
Edited by
Chen XingMicrosoft employee
Thursday, February 07, 2013 3:26 PM
-
Proposed as answer by
Chen XingMicrosoft employee
Thursday, February 07, 2013 5:18 PM
-
Marked as answer by
robi26
Wednesday, February 13, 2013 12:40 PM
February 7th, 2013 8:24pm
Try to modify the sorting order in the result source instead:
- Go to Search Administration in Central Administration.
- Click on Result Sources under the Queries and Results section.
- Edit a copy of Local People Results.
- Click the Launch Query Builder button and specify your desired sorting order there.
- Save and configure your web part to use the new result source.
-
Edited by
Chen XingMicrosoft employee
Thursday, February 07, 2013 3:26 PM
-
Proposed as answer by
Chen XingMicrosoft employee
Thursday, February 07, 2013 5:18 PM
-
Marked as answer by
robi26
Wednesday, February 13, 2013 12:40 PM
February 7th, 2013 8:24pm
Try to modify the sorting order in the result source instead:
- Go to Search Administration in Central Administration.
- Click on Result Sources under the Queries and Results section.
- Edit a copy of Local People Results.
- Click the Launch Query Builder button and specify your desired sorting order there.
- Save and configure your web part to use the new result source.
-
Edited by
Chen XingMicrosoft employee
Thursday, February 07, 2013 3:26 PM
-
Proposed as answer by
Chen XingMicrosoft employee
Thursday, February 07, 2013 5:18 PM
-
Marked as answer by
robi26
Wednesday, February 13, 2013 12:40 PM
February 7th, 2013 8:24pm
February 7th, 2013 9:31pm
Hmm...exactly what I said :)
February 8th, 2013 6:33am
LOL. You are correct. Still very strange and unexpected behavior.
Scot
February 8th, 2013 8:07am
Definitely :)
February 8th, 2013 8:24am
February 8th, 2013 3:02pm
Thanks! Works perfectly.
Stephan
February 13th, 2013 5:41pm
I've set the LastName as searchable, ran a full crawl, created a people result source but when I'm sorting it at the people result source part it is still not being ordered correctly when I hit Test. I can't believe how long I've spent on trying to
resolve a seemingly routine problem.
April 7th, 2015 10:05am
Thanks Scot, but that seems to imply I would have to install and deploy the 3rd party app. There is no way for SharePoint to do this out of the box? Is it a bug or is there another Search configuration that I need to change somewhere?
Thanks for your help.
April 7th, 2015 1:18pm
It's just an example. You can see how the LastName sort was setup for the app, but you don't need to use an app.
Scot
April 7th, 2015 3:02pm
Hi Scot, I'm struggling to see how it was setup sorry. We aren't using Office 365 and I've followed the instructions for setting up the LastName managed property. It's all highly frustrating :(
April 13th, 2015 10:19am
Hello Expert,
I am also facing the same issue with the people search sort by LastName.
I tried every option suggested above in the blog trail, but still no success.
Anyone has resolved this?
Please suggest if any input.
Regards,
Uday
June 24th, 2015 11:29am
Hello Expert,
Issue was with the crawling the content.
I missed out to look at the crawl logs.
I had made LastName managed property to sortbale along with that I marked it as MulitVlaue. (Same as FirstName)
Because of marked as "MultiValue" my crawler starts giving an error.
SharePoint 2013 Crawl Log Error: Index was out of range. Must be non-negative and less than the size of the collection
I refer below blog to know more about crawler functionality and its behavior for multi value properties.
http://aghy.hu/sharepoint-2013-crawl-log-error-index-was-out-of-range.-must-be-non-negative-and-less-than-the-size-of-the-collection
Regards,
Uday G
June 24th, 2015 12:16pm