I couldn't find the property either to use in a refinementpanel so I have used the SPSiteURL managed property to get the SiteCollectionUrl and show this.
The SPSiteURL was not 'friendly' enough, because the view would be like:
https://myurl.com/...
https://myurl.com/...
(URLS were too long)
With a custom display template I have mapped the URLs to friendly names.
If an URL is not available in the mapping, it just shows the url instead.
SharePoint does this technique itself with the FileType Managed Property. So I just tweaked that one a bit.
Create a copy of the normal Refinement item Display template and remove the bits you don't need.
These are the interesting parts for the mapping:
function mapSiteUrl(refinementName) {
var map = {};
map["MySiteName"] = {
"RefinerName": "SPSiteURL",
"RefinementValue": "http://MySiteUrl"
};
map["MySiteName2"] = {
"RefinerName": "SPSiteURL",
"RefinementValue": "http://MySiteUrl2"
};
map["MySiteName3"] = {
"RefinerName": "SPSiteURL",
"RefinementValue": "http://MySiteUrl3"
};
var mappedRefinementName = null;
for (var key in map) {
if (refinementName.toLowerCase() === map[key].RefinementValue.toLowerCase()) {
mappedRefinementName = key;
break;
}
}
if ($isNull(mappedRefinementName)) {
mappedRefinementName = refinementName;
}
return mappedRefinementName;
}
var listData = ctx.ListData;
var hasControl = true;
var shortListSize = 5;
if ($isNull(ctx.RefinementControl) || $isNull(ctx.ClientControl)) hasControl = false;
if (ctx.RefinementControl.propertyName == "SPSiteURL") {
shortListSize = 6;
for (var i in listData) {
listData[i].RefinementTokens = [listData[i].RefinementToken];
listData[i].RefinementName = mapSiteUrl(listData[i].RefinementName);
listData[i].RefinementTokenWrappedValues = [Srch.RefinementUtil.stringValueToEqualsToken(listData[i].RefinementValue)];
}
}
Basically what it does is check if the propertyName is SPSiteURL:
if(ctx.RefinementControl.propertyName == "SPSiteURL")
then calls the function to map the friendlynames to the urls:
listData[i].RefinementName = mapSiteUrl(listData[i].RefinementName);
The mapping happens here:
map["MyFriendlyName1"] = {
"RefinerName": "SPSiteURL",
"RefinementValue": ["http://myurl.com"]
};
Just copy and paste it to make more of these mappings.
Then, just pick your new Display Template as an option for the SPSiteURL Managed Property in the web part properties.