You are currently browsing legacy 3.5 version of documentation. Click here to switch to the newest 5.1 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Commands: Indexes: How to check if an index has changed?

IndexHasChanged will let you check if the given index definition differs from the one on a server. This might be useful when you want to check the prior index deployment, if index will be overwritten, and if indexing data will be lost.


bool IndexHasChanged(string name, IndexDefinition indexDef);
name string name of an index to check
indexDef IndexDefinition index definition
Return Value
true if an index does not exist on a server
true if an index definition does not match the one from the indexDef parameter
false if there are no differences between an index definition on server and the one from the indexDef parameter


store.DatabaseCommands.IndexHasChanged("Orders/Totals", indexDefinition);