Share via


SharePoint search service application crawling stuck on starting, completing or stopping mode:

I usually use powershell to check the status of the services. You can check the status from central administration or using below powershell:
Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service Application Name" | select Name, CrawlStatus

If the crawl status is not Idle and it get stuck on starting, completing or stopping mode then run the below powershell:
Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service Application Name" | ForEach-Object {
    if ($_.CrawlStatus -ne "Idle")
    {
        Write-Host "Stopping currently running crawl for content source $($_.Name)"
        $_.StopCrawl()
        
        do { Start-Sleep -Seconds 1 }
        while ($_.CrawlStatus -ne "Idle")
    }
}

Above powershell script will check the below things:
i) Content source crawl status is not idle
ii) If crawl status is not Idle then it will get the name of all the content sources and stop all the crawls.

Note: i) Replace the name of the search service application name in above powershell 
ii) You can get the name of search service application from central administration-> Application management -> Manage service application or you can run the below powershell and get the name of search service application:
Get-SPServiceApplication | Select DisplayName 

It will take 10- 15 minutes to stop all the crawl and once after stopping all the crawl please run crawl one by one.