Zozala Zozala - 2 years ago 101
C# Question

Sitecore check if index is complete

Is there a way in Sitecore in code that you can check if the lucene index exists or is complete?

We are in the making of a mechanism that will check if the index exists or is complete. If not it needs to be rebuild.

Edit: We use Sitecore version 7.2

Answer Source

In general, you have strategies like OnPublishEndAsync, IntervalAsynchronous etc. to keep your index up to date and they should be taking care of the completeness of it.

In the real world during rollouts, longer downtimes, network issues etc. the index can become inconsistent with the Sitecore tree or the rest of the indexes in your farm. In order to find out if the index(es) is(are) complete, you'd have to compare the Sitecore tree to the content of every single index in your web farm. That would require scanning through the tree, querying the index and doing a both-way comparison.

Given the difficulty of that task I would consider a combination of the Manual Strategy and the RemoteRebuildStrategy and do a nightly rebuild (if the availability requirements allow this).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download