Steps- Start your windows PowerShell on your computer.
- Right click and select Run as administrator option.
- Paste the below script on the PowerShell window and click the enter button.
- Check your SharePoint site Feature will activated successfully
The script below walks through each content source and does the following:
- Checks whether the crawl status is set to “Idle”
- If the content source is currently involved in a crawl activity, stop the activity and wait until the status changes back to Idle
- If the content source is Idle, then start a full crawl
- Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service Application" | ForEach-Object {
- if ($_.CrawlStatus -ne "Idle")
- {
- Write-Host "crawl stooping currently for content source $($_.Name)..."
- $_.StopCrawl()
-
- do { Start-Sleep -Seconds 1 }
- while ($_.CrawlStatus -ne "Idle")
- }
-
- Write-Host "Full crawl started for content source $($_.Name)..."
- $_.StartFullCrawl()
- }
Run the script and following script if you want to display the crawl status of all content sources on your farm:
- Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service Application" | select Name, CrawlStatus