How i can do a case-insensitive sort inside my content search web part
-
02-01-2021 - |
سؤال
I am working on a content search web part, which show a list of sub-sites under the current site collection.
now i want to Sort the sub-sites inside the webpart using their site description field. and to do so i map the Refinablestring01
managed property with the ows_SiteDescription
crawl property as follow:-
then inside my content search web part i chose to sort the results using the refinablestring01
managed property as follow:-
now the problem is that the sort i am receiving is case sensitive. as if i have a site with the following description "This site was created upon manager request" will be shown before a site with the following description "abc". so if the site start with an upper case it will always be shown before lower case. so is there a way to force a case-insensitve sort inside my content search webpart ? now if i change the first site description to start with a lower case as follow "this site was created upon manager request" then this site will be shown after "abc".. Thanks
المحلول
In SharePoint Search, it will sort Character with "A-Z" then "a-z", it is by design, because Lower Case character will have a larger ASCII value compare with Upper Case character. SharePoint Search will sort based on ASCII value.
Case insensitive sorting in SharePoint
A workaround is that create a new field with all character converted to Lower Case character and then sort by the new field instead.