Managing the SP Gatherer's temp files
While the SharePoint Gatherer is processing files (Office documents, PDFs, etc), it will store them temporarily on local disk. By default this is in the Temp folder of the user running the OSearch14 service. It'll look something like:
C:\Users\SHAREP~1\AppData\Local\Temp\gthrsvc_OSearch14
And during a large crawl, this directory can at times get quite large. (as I found out today when a dev server started complaining abou the C drive being full)
Moving it is easy enough and there are 2 ways.
First, update the service application:
$searchapp= Get-SPEnterpriseSearchServiceApplication -identity "FAST Content SSA"
$searchapp.TempPath = "D:\SearchTemp"
Note that setting the path takes effect immediately. No need to call the $searchapp.Update() method.
UPDATE 5/17/2013
If you use the SSA.TempPath approach and have multiple crawlers, you need to make sure to run the command on each server anyway.
Second approach is to update the registry directly:
$gmpath = 'HKLM:\Software\Microsoft\Office Server\14.0\Search\Global\Gathering Manager'
Set-ItemProperty -Path $gmpath -Name UseSystemTemp -Value 0
Set-ItemProperty -Path $gmpath -Name TempPath -Value "D:\SearchTemp"
Restart-Service OSearch14
And don't forget to exclude the new temp folder from any AV scans.
(Thanks Sreedhar)
Reference
https://technet.microsoft.com/en-us/library/ee513078.aspx
Comments
Anonymous
October 08, 2013
Sadly, it doesnt work on sharepoint 2013, the key gets overwritten :)Anonymous
March 31, 2015
Is there a way to change it on Sharepoint 2013?Anonymous
May 15, 2015
Does anyone know if the files in the Gthrsvc_OSearch14 folder can be deleted?. I have 64 gigs of flt*.PDF files in this folder. I cannot find anywhere that mentions maintenance of these files - if it is safe to delete older files from this directory. Any input on this - greatly appreciated.Anonymous
February 16, 2016
The comment has been removed