You are currently browsing legacy 4.0 version of documentation. Click here to switch to the newest 4.2 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Operations: How to Disable an Index

The DisableIndexOperation is used to turn the indexing off for a given index. Querying a disabled index is allowed, but it may return stale results.

Note

Unlike StopIndex or StopIndexing disable index is a persistent operation, so the index remains disabled even after a server restart.

Syntax

public DisableIndexOperation(String indexName)

Parameters
indexName String name of an index to disable indexing

Example

store.maintenance().send(new DisableIndexOperation("Orders/Totals"));
// index is disabled at this point, new data won't be indexed
// but you can still query on this index