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

Operations: How to Change Index Priority

SetIndexesPriorityOperation allows you to change an index priority for a given index or indexes.


public SetIndexesPriorityOperation(String indexName, IndexPriority priority) {
public SetIndexesPriorityOperation(SetIndexesPriorityOperation.Parameters parameters)

public enum IndexPriority {

public static class Parameters {
    private String[] indexNames;
    private IndexPriority priority;

    public String[] getIndexNames() {
        return indexNames;

    public void setIndexNames(String[] indexNames) {
        this.indexNames = indexNames;

    public IndexPriority getPriority() {
        return priority;

    public void setPriority(IndexPriority priority) {
        this.priority = priority;
name String name of an index to change priority for
priority IndexingPriority new index priority
parameters SetIndexesPriorityOperation.Parameters list of indexes + new index priority

Example I

    new SetIndexesPriorityOperation("Orders/Totals", IndexPriority.HIGH));

Example II

SetIndexesPriorityOperation.Parameters parameters = new SetIndexesPriorityOperation.Parameters();
parameters.setIndexNames(new String[]{ "Orders/Totals", "Orders/ByCompany" });

store.maintenance().send(new SetIndexesPriorityOperation(parameters));