You are currently browsing legacy 3.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

Commands: Indexes: How to change index priority?

SetIndexPriority method allows you to change index priority for a given index.

Syntax

void SetIndexPriority(string name, IndexingPriority priority);

[Flags]
private enum IndexingPriority
{
	None = 0,
	Normal = 1,
	Disabled = 2,
	Idle = 4,
	Abandoned = 8,
	Error = 16,
	Forced = 512,
}

Parameters
name string name of an index to change priority for
priority IndexingPriority new index priority

Example

store.DatabaseCommands.SetIndexPriority("Orders/Totals", IndexingPriority.Disabled);