I have created a custom search results web part which implements some simple sorting, for example i have this piece of code which allows me to sort it desc/asc by title:
CoreResultsDatasource dataSource = this.DataSource as CoreResultsDatasource;
if (!string.IsNullOrEmpty(OrderByProperty))
{
// change the sortorder
dataSource.SortOrder.Clear();
dataSource.SortOrder.Add(OrderByProperty, SortDirection);
}
Basically it works for the title, but when i want to sort by Modified Date, it doesnt work, i get an error in the webapart:
Property doesn't exist or is used in a manner inconsistent with schema settings.
I did try to add it in: Core Search Results Display Metadata => Properties
But still nothing happens.
Any idea how can i do it?
PS: I tried to pass "ModifiedDate" and i tried to pass "LastModifiedTime" Another strange issue i notice is that when i pass a title outside of search center it breaks i get an "Internal error" no errors in the log.
write
managed property. Also, delete all none existing managed properties from Core Search Results Display Metadata => Properties to error disappear.