When a user changes the name or deletes an item with a Lucene index attached to it, Sitecore will throw errors when using any index based functionality - it can break site sometimes.

I can think of 2 possible solutions:

  1. Make Sitecore ignore indexes with non existent items.
  2. Try to block item somehow so it cant be renamed/unpublished/deleted by user

What do you think? I will need some details on two solutions.


Clarification: I'm talking about the index root item. For example I have site with news and the root item is news/technology. If the user deletes or renames this item, there is problem.

  • Please add more details of the error you are getting, What do you mean by "there is a problem"? Commented Sep 21, 2017 at 16:18

2 Answers 2


Protect The Item

Sitecore has a built-in functionality to solve exactly cases like this; where configuration or system parts rely on a particular Sitecore Item being present and unchanged.

enter image description here

Once an item is protected like this, it cannot be changed or deleted - even by admin users. Admin users are given the option to first unprotect the item before making any changes (alerting them to be aware there is something special about this item). Non-admin users cannot unprotect.

  • Only problem is the user need to change this item frequently. Its container for articles but also have some fields editable.
    – tommy1024
    Commented Sep 21, 2017 at 12:19
  • Then remove the user's right to delete.
    – Mark Cassidy
    Commented Sep 21, 2017 at 12:36

From what I understand, you're experiencing issue when:

  • author removes item from Sitecore
  • end user tries to open a page and get error because item wasn't removed from Lucene index yet.

If that's the case, my answer is: "never trust data which is coming from index".

If you have SearchHit and you try to call GetItem() after, always check if it's not null. That should be enough to not get an exception if the item wasn't removed from the index between Sitecore deletion and user page visit.

  • Its not about that - for example i have a news site with item: /news/technology - and here are my indexed articles. When user deletes this item or chaning name then we get error that tells us that root item for index not exists.
    – tommy1024
    Commented Sep 21, 2017 at 8:24

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.