We are programmatically creating items and using Solr indexes so we want to disable solr indexing whenever we create an item.

We tried following code to disable during item creation Item.Add()

Sitecore.Configuration.Settings.Indexing.Enabled = false;

But it does not stop indexing and still happen in Solr. What can be the possible reason?

2 Answers 2


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

// Add code to create item

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

IndexCustodian.IsIndexingPaused(ISearchIndex index )
  • Thanks for giving the complete namespace of the IndexCustodian - I was struggeling to find it. Commented Jun 21, 2022 at 13:10

You can do in next way :

  // Create items, etc 
  // Enable indexing again. 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.