Created
June 20, 2014 07:07
-
-
Save ishajain/61c0b3b3a2190526f923 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment