In order to display search results using custom sorting order the following Search Results customization should be applied:
Note: The customization described below are verified with People Search
Core Results web part.
Important: But before we proceed let me clarify the main
limitation of this approach: solution described below allows to sort search results returned not for all results but for results
returned for current page only.
Configure Managed Property
In order to LastName to be used in search results it should be configured first. For more details please see Manage metadata properties for search (SharePoint Server 2010)
Steps:
- In Central Administration, in the Application Management section,
click Manage service applications
- Click the Search service application
- On the Search Administration page, in the Quick Launch, under
Queries and Results, click Metadata Properties. Mapped properties
appear.
- Find property with name LastName (OOTB LastName property from User Profile is used here) and click on link item.
Make sure that settings for LastName property has the following
options enabled (see picture below):
- Allow this property to be used in scopes
- Add managed property to custom results set retrieved on each query

- After saving changes for metadata property go to Content Sources
- Find Content Source for My Site and start Full Crawl and wait until it will be completed (for details about deploying people search follow here). In my case it is separate Data Source for My Sites hosted on Site Collection (see screenshot below)

Configure People Search Core Results web part
In order results to be sorted by LastName property the following properties for People Search Core Results should be modified:
Steps:
Open the People search results web part in edit mode
Under Location Properties -> Display Properties uncheck Use
Local Visualization
- Add LastName property to Fetched properties:
<Column
Name="LastName"/>
(Here you could find value for Fetched
properties with custom property LastName specified)
- Click on XSL editor and add in text the following line
<xsl:sort
data-type="text" order="ascending" select="lastname"/>
after line
<xsl:for-each select="All_Results/Result">
For more details about
XSL sort see here (Here you could find full XSL for this example)
Results
After these changes you should be able to see people search results sorted by custom property (LastName in our case)
Search result page with results sorted by LastName in ascending order is shown below

For more details about Xslt based approach for sorting search results please follow my post Customizing Search Results (SharePoint 2010): People Search Results Custom Sorting using XSLT
Alternative solutions
If limitations of previous solution is not an options for you, then I suggest you to implement custom web part with custom sorting options.
I also strongly suggest you to implement custom People Core Results web part by deriving it from CoreResultsWebPart class and not implement it from from scratch.
Note: Custom People Core Results web part could not be derived
directly from PeopleCoreResultsWebPart because it is marked as Sealed
class.
For example, below is presented code, where two public properties OrderByProperty
and SortDirection
allows to define sorting options:
[ToolboxItemAttribute(false)]
public class SortablePeopleCoreResultsWebPart : CoreResultsWebPart
{
[Personalizable(PersonalizationScope.Shared)]
[WebBrowsable(true)]
[WebDescription("Sort by this managed property")]
public string OrderByProperty { get; set; }
[Personalizable(PersonalizationScope.Shared)]
[WebBrowsable(true)]
[WebDescription("Sort direction")]
public Microsoft.Office.Server.Search.Query.SortDirection SortDirection { get; set; }
/// <summary>
/// Override. First runs the base code, than collects the CoreResultsDatasource and
/// sets the SortOrder property.
/// </summary>
protected override void ConfigureDataSourceProperties()
{
// only do stuff when search results are visible
if (this.ShowSearchResults)
{
// run the base code
base.ConfigureDataSourceProperties();
try
{
// if OrderByProperty is not set, use default behaviour
if (!string.IsNullOrEmpty(OrderByProperty))
{
// get the datasource and change the sortorder
CoreResultsDatasource dataSource = this.DataSource as CoreResultsDatasource;
dataSource.SortOrder.Clear();
dataSource.SortOrder.Add(OrderByProperty, SortDirection);
}
}
catch (Exception)
{
// handle this error! and show a friendly error message
}
}
}
}