Hi Again,
I came up with a requirement where I want to show the custom managed metadata property in the search refinement web part in the search results page.
By default the refinable property of any managed property is non set as false/not active. In order to show a property in the search refinement web part , it has to be active/true.
Below is the PowerShell script I wrote to update the custom managed metadata refinable property and then I did the full crawl.
Hope this is helpful.
Cheers,
Isha Jain
I came up with a requirement where I want to show the custom managed metadata property in the search refinement web part in the search results page.
By default the refinable property of any managed property is non set as false/not active. In order to show a property in the search refinement web part , it has to be active/true.
Below is the PowerShell script I wrote to update the custom managed metadata refinable property and then I did the full crawl.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Checking the Refiners refinable property for Managed Properties | |
Write-Host "Checking for refinable property for managed property" -ForegroundColor Yellow | |
$searchServiceApp=Get-SPEnterpriseSearchServiceApplication | |
$isFullCrawlRequired=$false; | |
#Custom Audience Managed Property | |
Write-Host "Checking refinable property for CustomAudience" -ForegroundColor Yellow | |
$audience= Get-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $searchServiceApp | ? {$_.Name -eq "owstaxidCustomAudience"} | |
#Metadata Managed Property is always starts with owstaxid* | |
if($audience.Refinable -eq $false){ | |
$audience.Refinable =$true | |
$audience.Update() | |
$isFullCrawlRequired=$true | |
} | |
if($isFullCrawlRequired -eq $false ) | |
{ | |
$customContentsources=Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $searchServiceApp | ? {$_.Name -eq 'YourContentSourceName'} | |
if($customContentsources -ne $null) | |
{ | |
Write-Host "Full crawl has started..." -ForegroundColor Yellow | |
$customContentsources.StartFullCrawl() | |
do {Start-Sleep -s 1} while ($customContentsources.CrawlStatus -ne "Idle") | |
Write-Host "Full crawl is completed successfully..." -ForegroundColor Green | |
} | |
} |
Hope this is helpful.
Cheers,
Isha Jain
Useful!
ReplyDeleteThanks
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteA big thanks to you for showing the custom managed metadata property in the search refinement web part in the search results page. You are doing great.
ReplyDeleteYou can visit USA VPS Hosting for the reliable server hosting. It will help you to grow your online business.
This is really interesting blog and the information given in it is very creative from which we have got to learn a lot.if you want to know something about server hosting then see you should know about USA VPS Hosting and how it can be important for this modern world. Thanks once again.
ReplyDelete