Disabling Sitecore search index update during package install will speed up the installation, making it noticable quicker for large packages. We found a good blog post about this by Alex Shyba. During the implementation of that solution we found an enhancement to do.
Instead of enabling the indexing again after the user clicks “close” in the installation wizard this tutorial will re-enable it directly after the installation is finished (before the user clicks close). This will avoid having the indexing disabled if you open another window or browse away from the sitecore gui directly after installing and not clicking close.
This code is tested in Sitecore 8.
1. Custom packager class
Add a new class that will handle enable and disable indexing and make it look like this (code borrowed from Alex Shyba)
2. Copy install package wizard
Copy /sitecore/shell/Applications/Install/Dialogs/Install package/Install Package.xml to /sitecore/shell/override Open that file and edit the codebeside attribute to this:
Also add a checkbox to that xml markup between GridPanel and WizardFormIndent
3. Enhancing functionality
The code above is, as said before, borrowed from Alex. Now to enhance this code to re-enable the indexing directly after package is installed but before clicking the close button. Open web.config and search for packageinstall:ended and edit it to look like this:
Now go back to the CustomInstallPackageForm and lets edit it to look like this instead:
The EndWizard() method and contents is removed and replaced by another method called OnPackageInstallEnded(). This method is referenced from web.config. And as said before, it’s a smaller risk that the indexing will be left disabled with this approach. The checkbox needs to be static as well, because the wizard and the callback is run by different threads.
Something to think about is that both these solutions might enable indexing for another user if more than one is installing packages at the same time. Thanks to Peter Grace for the ideas!
I hope you find this post valuable. If you click the ad below I get paid by someone else and can continue to publish posts for free. I would appreciate it very much.