If the refiners being used on your search page are a custom metadata term (They have a name like "owstaxId...") you will need to add additional sort options to the "Display template" being used by the Refinement webpart.
The Display Template is choosen within the Refinement configuration popup window when you edit the Refinement web part. The display template being used here need to be edited. This Display Template is a html file located on the SharePoint server in
the _catalogs\masterpage\Display Template\Filters folder. Do NOT edit the .js file. It will update automatically when you save your html file. Edit the filter file that is being used by your search page in notepad or an editor
of your choice. (notepad++ is ideal for this).
The default code in the filter file only contains sort functions for "FileType." You will have to add code for filtering on your custom "owstaxId..." properties in three sections as shown below.
At about line 314, the filter html file contains the "ctx.RefinementControl.propertyName" code. After this section you need to add additional "if (ctx.RefinementControl.propertyName == "owstaxIdyourpropertyname")" lines of code
as shown below marked by -->. Be sure not to include the --> in the actual code.
if (ctx.RefinementControl.propertyName == "FileType")
{
if (unselectedFilters.length <= shortListSize) {
unselectedFilters = unselectedFilters.sort(SortAlphabetically);
} else {
unselectedFilters = unselectedFilters.sort(SortByCountDescending);
}
selectedFilters = selectedFilters.sort(SortAlphabetically);
}
--> if (ctx.RefinementControl.propertyName == "owstaxIdyourpropertyname1")
--> {
--> unselectedFilters = unselectedFilters.sort(SortAlphabetically);
--> selectedFilters = selectedFilters.sort(SortAlphabetically);
--> }
--> if (ctx.RefinementControl.propertyName == "owstaxIdyourpropertyname2")
--> {
--> unselectedFilters = unselectedFilters.sort(SortAlphabetically);
--> selectedFilters = selectedFilters.sort(SortAlphabetically);
--> }
if (selectedFilters.length > 0 || hasAnyFiltertokens)
{
About 50 lines further down you need to add a second section of custom code as shown below for "owstaxIdyourpropertyname".
if (shortListSize < unselectedFilters.length) {
numShortList = shortListSize;
if (ctx.RefinementControl.propertyName == "FileType") {
shortList = unselectedFilters.slice(0, numShortList).sort(SortAlphabetically);
}
--> if (ctx.RefinementControl.propertyName == "owstaxIdyourpropertyname1") {
--> shortList = unselectedFilters.slice(0, numShortList).sort(SortAlphabetically);
--> }
--> if (ctx.RefinementControl.propertyName == "owstaxIdyourpropertyname2") {
--> shortList = unselectedFilters.slice(0, numShortList).sort(SortAlphabetically);
--> }
}
About 30 lines further down you need to add third section of custom code as shown below for "owstaxIdyourpropertyname".
<!--#_
if (ctx.RefinementControl.propertyName == "FileType") {
unselectedFilters = unselectedFilters.sort(SortAlphabetically);
}
--> if (ctx.RefinementControl.propertyName == "owstaxIdyourpropertyname1") {
--> unselectedFilters = unselectedFilters.sort(SortAlphabetically);
--> }
--> if (ctx.RefinementControl.propertyName == "owstaxIdyourpropertyname2") {
--> unselectedFilters = unselectedFilters.sort(SortAlphabetically);
--> }
for (var i = 0;
Save the html file. Wait for the .js to update automatically.
NOTE: If you also made any changes to your display templates, like other assets in the Master Page Gallery, they must be Published in order for all users to use them. Once you have completed your edits, return to the Mater Page Gallery and
Publish a Major Version of the files so that your users will be able to see them.