Published Date: 17 November, 2019
Sitecore solr

Recently we came into a requirement where we need to send email whenever sitecore user trigger rebuild index manually. We also need to send email once that index gets completed.

Sitecore does not provide any event for rebuild index like publishing. We have Publish:end and Publish:end:remote event for publishing but don’t have similar event for rebuild index.

After seaching a lot over google, we could not find any blog regarding the same. Hence, I posted this question on Stack Exchange. I found answer of first part (sending email just after triggering manual build index).

https://sitecore.stackexchange.com/questions/22997/sitecore-rebuild-index-complete-tracking

This help was enough so we found the answer of other part as well. So thought to share the same with Sitecore Community.

Solution:

We have to override the IndexingManager wizard. When you open Indexing Manager popup from Sitecore Control Panel below files being used to call it’s respective code: \sitecore\shell\Applications\ContentSearch\IndexingManager.xml We need to change this with our own class:

Add the reference of the below assemblies in your project:

  • Sitecore.ContentSearch.dll
  • Sitecore.ContentSearch.Client.dll

Now need to create a class CustomIndexingManagerWizard:

http://www.tekkishare.com

When you see the above code, method FullRebuild() is a Sitecore job. Sitecore job has a Finished event as well. So I used this event to track the Rebuild Index Complete task.

Thanks for your time
Happy learning.:



References:

Sitecore solr