Hello,
I have a farm with 2 servers and the following relevant configurations:
- 1 SharePoint server (for all roles)
- 1 database
- Search Schedule:
- Full Crawl: Once per week, on Saturday at 2AM
- Incremental Crawl: Every 30 minutes
- No Continuous Crawling is being used
By default, this installation, installed the default search index location to the C: drive, in C:\SearchIndex.
In the meantime, I implemented a powershell script that moved the search index to the E: drive, to E:\SharePointSearchIndex.
Here is the script:
$ssa = Get-SPEnterpriseSearchServiceApplication "Search Service Application"
$instance = Get-SPEnterpriseSearchServiceInstance -Local
$current = Get-SPEnterpriseSearchTopology -SearchApplication $ssa
# Clone the current Search topology
$clone = New-SPEnterpriseSearchTopology -Clone -SearchApplication $ssa -SearchTopology $current
# Modify the cloned Search topology
New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -IndexPartition 0 -SearchServiceInstance $instance -RootDirectory "E:\SharePointSearchIndex"
# Activate the cloned Search topology
Set-SPEnterpriseSearchTopology -Identity $clone
# Remove the old Search topology
Remove-SPEnterpriseSearchTopology -Identity $current
# Remove the old index component
$currentTopology = Get-SPEnterpriseSearchTopology -SearchApplication $ssa
$cloneTopology = New-SPEnterpriseSearchTopology -Clone -SearchApplication $ssa -SearchTopology $currentTopology
$comp = Get-SPEnterpriseSearchComponent -SearchTopology $cloneTopology | ? {$_.Name -eq "IndexComponent1"}
Remove-SPEnterpriseSearchComponent -Identity $comp -SearchTopology $cloneTopology
Set-SPEnterpriseSearchTopology -Identity $cloneTopology
Remove-SPEnterpriseSearchTopology -Identity $currentTopology
After running this script, I noticed the search index started to be written to the E: drive but during a Full Crawl the old location was also being written (about 10GB during a Full Crawl of a 180GB database). After Full Crawl completion, all the content in
the old location in C: was deleted, and the search index files are as intended written to the E: drive.
I run a few PowerShell scripts to try to get a view of the farm search service configurations with the following results:
A - Getting Details on the Active Topology
In this case, the index location is correctly configured to the intended location: E:\SharePointSearchIndex
$ssa = Get-SPEnterpriseSearchServiceApplication "Search Service Application"
$activeTopology = $ssa.ActiveTopology
Get-SPEnterpriseSearchComponent -SearchTopology $activeTopology
B - Getting default search service components
In this case, the default index location is still configured to old location: C:\SearchIndex
$ssi = Get-SPEnterpriseSearchServiceInstance
$ssi.Components
C - Have a look on all search topologies. In this case, there is 1 active and 2 inactive topologies
Get-SPEnterpriseSearchTopology -SearchApplication $ssa
My questions are:
1 - Although, I ran the above PowerShell script, why is data, why is data still being writeen to the C: drive (C:\SearchIndex) during crawls? My main concern is the Full Crawl that writes more than 10GB of data to the C: drive during the crawling process
2 - Is it possible to change the default location of the index location and guarantee that nothing is written to the C: drive but to the E: instead?
I run the following script to try to achieve this but with no results:
$indexLocation = "E:\SharePointSearchIndex"
# Get the current Search topology
$ssa = Get-SPEnterpriseSearchServiceApplication "Search Service Application"
$instance = Get-SPEnterpriseSearchServiceInstance -Local
$current = Get-SPEnterpriseSearchTopology -SearchApplication $ssa
# set the default index location
$instance | Set-SPEnterpriseSearchServiceInstance -DefaultIndexLocation $indexLocation -ErrorAction SilentlyContinue
If I run again:
$ssi = Get-SPEnterpriseSearchServiceInstance
$ssi.Components
I still receive the indication that the index location is in C:\SearchIndex
Thanks,
Miguel