Skip to main content

Code which you have used, it works only for "old" indexes, but not for the Sitecore 7 indexes. I am sure you must be using old one.

You should try to disable/enable indexing as follows

Sitecore.ContentSearch.Maintenance.IndexCustodian.PauseIndexing();
// Add code to create item
IndexCustodian.ResumeIndexing();

Also add check whether indexing is currently paused or not with the use of the following:

IndexCustodian.IsIndexingPaused(ISearchIndex index )
Rohit Chopra
  • 1.5k
  • 2
  • 30
  • 51