---
title: "Index Administration"
description: "* Indexes can be easily managed from the Studio"
url: "https://docs.ravendb.net/6.2/indexes/index-administration"
version: "6.2"
---

# Index Administration

> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

## Index Administration

> **Note**
>
> - Indexes can be easily managed from the [Studio](https://docs.ravendb.net/6.2/studio/database/indexes/indexes-list-view.md#indexes-list-view)
>   or via [Maintenance operations](https://docs.ravendb.net/6.2/client-api/operations/what-are-operations.md#maintenance-operations) in the Client API.
>
> - In this article:
>   - [Index management operations](#index-management-operations)
>     - [Pause & resume index](#pause--resume-index)
>     - [Pause & resume indexing](#pause--resume-indexing)
>     - [Disable & enable index](#disable--enable-index)
>     - [Disable & enable indexing](#disable--enable-indexing)
>     - [Reset index](#reset-index)
>     - [Delete index](#delete-index)
>     - [Set index lock mode](#set-index-lock-mode)
>     - [Set index priority](#set-index-priority)
>   - [Index states](#index-states)
>   - [Customize indexing configuration](#customize-indexing-configuration)

## Index management operations

> **Note**
>
> ##### Pause & resume index
>
> - An index can be paused (and resumed).
>
> - See [pause index](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/stop-index.md) & [resume index](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/start-index.md) for detailed information.
>
> - Operation scope: Single node.

> **Note**
>
> ##### Pause & resume indexing
>
> - You can pause (and resume) indexing of ALL indexes.
>
> - See [pause indexing](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/stop-indexing.md) & [resume indexing](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/start-indexing.md) for detailed information.
>
> - Operation scope: Single node.

> **Note**
>
> ##### Disable & enable index
>
> - An index can be disabled (and enabled), this is a persistent operation.
>
> - See [disable index](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/disable-index.md) & [enable index](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/enable-index.md) for detailed information.
>
> - Operation scope: Single node, or all database-group nodes.

> **Note**
>
> ##### Disable & enable indexing
>
> - Indexing can be disabled (and enabled) for ALL indexes, this is a persistent operation.
>
> - This is done from the [database list view](https://docs.ravendb.net/6.2/studio/database/databases-list-view.md#more-actions) in the Studio.
>
> - Operation scope: All database-group nodes.

> **Note**
>
> ##### Reset index
>
> - Resetting an index will force re-indexing of all documents that match the index definition.  
>   An index usually needs to be reset once it reached its error quota and is in an *Error* state.
>   An index usually needs to be reset when it reaches its error quota and enters the *Error* state.
>
> - See [reset index](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/reset-index.md) for detailed information.
>
> - Operation scope: Single node.

> **Note**
>
> ##### Delete index
>
> - An index can be deleted from the database.
>
> - See [delete index](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/delete-index.md) for detailed information.
>
> - Operation scope: All database-group nodes.

> **Note**
>
> ##### Set index lock mode
>
> - The lock mode controls whether modifications to the index definition are applied (static indexes only).
>
> - See [set index lock](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/set-index-lock.md) for detailed information.
>
> - Operation scope: All database-group nodes.

> **Note**
>
> ##### Set index priority
>
> - Each index has a dedicated thread that handles all the work for the index.  
>   Setting the index priority will affect the thread priority at the operating system level.
>
> - See [set index priority](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/set-index-priority.md) for detailed information.
>
> - Operation scope: All database-group nodes.

## Index states

An index can be in one of the following states:

- `Normal`
  - The index is active, any new data is indexed.

- `Paused`
  - New data is not being indexed.
  - Queries will be stale as new data is not indexed.
  - The indexing process will resume upon any of the following actions:
    - Setting *'Resume indexing'* from the [Studio](https://docs.ravendb.net/6.2/studio/database/indexes/indexes-list-view.md#indexes-list-view---actions).
    - Resume indexing from the Client API. See [Resume index operation](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/start-index.md).
    - Restarting the server.
    - Reloading the database. See [How to reload the database](https://docs.ravendb.net/6.2/studio/database/settings/database-settings.md#how-to-reload-the-database).

- `Disabled`
  - New data is not being indexed.
  - Queries will be stale as new data is not indexed.
  - The indexing process will resume upon either of the following:
    - Setting *'Enable indexing'* from the [Studio](https://docs.ravendb.net/6.2/studio/database/indexes/indexes-list-view.md#indexes-list-view---actions).
    - Resume indexing from the Client API. See [Enable index operation](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/enable-index.md).
  - The index will NOT automatically resume upon restarting the server or reloading the database.

- `Idle` (auto-indexes only)

  - An auto-index is marked as *'Idle'* when it has not been queried for a configurable period of time.  
    This state indicates that the index may later be deleted, as detailed in the following points:

  - Specifically, an **auto-index** is marked as *'Idle'* when the time difference between its last-query-time
    and the most recent time the database was queried (using any other index) exceeds a configurable threshold. This threshold is set by the
    [Indexing.TimeToWaitBeforeMarkingAutoIndexAsIdleInMin](https://docs.ravendb.net/6.2/server/configuration/indexing-configuration.md#indexingtimetowaitbeforemarkingautoindexasidleinmin) configuration key (30 minutes by default).

  - This mechanism is designed to prevent auto-indexes from being marked as idle in databases that were offline for a long period,
    had no new data to index, were not queried, or were recently restored from a snapshot or backup.

  - While an auto-index is *'Idle'*, it is NOT considered *'Disabled'*.  
    **It continues to index data** from any documents relevant to its definition as they are created or modified.

  - An idle auto-index returns to the *'Normal'* state in the following cases:
    - When it is queried again.
    - When the auto-index is reset.
    - When [the database is reloaded](https://docs.ravendb.net/6.2/studio/database/settings/database-settings.md#how-to-reload-the-database).

  - If the idle auto-index is Not returned to the *'Normal'* state, the server will **delete** it after a configurable time period,  
    set by the [Indexing.TimeToWaitBeforeDeletingAutoIndexMarkedAsIdleInHrs](https://docs.ravendb.net/6.2/server/configuration/indexing-configuration.md#indexingtimetowaitbeforedeletingautoindexmarkedasidleinhrs) configuration key (72 hours by default).

  - Note:  
    The server evaluates whether an auto-index should be marked as idle, or whether an idle auto-index should be deleted,  
    at intervals defined by the [Indexing.CleanupIntervalInMin](https://docs.ravendb.net/6.2/server/configuration/indexing-configuration.md#indexingcleanupintervalinmin) configuration key (10 minutes by default).  
    If *TimeToWaitBeforeMarkingAutoIndexAsIdleInMin* or *TimeToWaitBeforeDeletingAutoIndexMarkedAsIdleInHrs*  
    are set to values smaller than the cleanup interval, the index will be marked as idle or deleted only after the cleanup interval elapses.

- `Error`
  - An indexing error can occur when the indexing-function is malformed (e.g., incorrectly written)  
    or when the document data is corrupted/missing.
  - Once the index error rate exceeds a certain threshold (as described in [Marking index as errored](https://docs.ravendb.net/6.2/indexes/troubleshooting/debugging-index-errors.md#marking-index-as-errored)),  
    the index state is marked as *'Error'*.
  - An errored index cannot be queried - all queries against it will result in an exception.
  - Learn more in [Debugging index errors](https://docs.ravendb.net/6.2/indexes/troubleshooting/debugging-index-errors.md).

- `Faulty`
  - When an index is successfully defined but the server fails to open its index data file from disk, or if this file is corrupted,  
    the server marks the index as *'Faulty'*, indicating that something is wrong with its index data files.
  - Learn more in [Faulty index](https://docs.ravendb.net/6.2/studio/database/indexes/indexes-list-view.md#indexes-list-view---errors).

## Customize indexing configuration

- There are many [indexing configuration](https://docs.ravendb.net/6.2/server/configuration/indexing-configuration.md) options available.

- A configuration key with a **"per-index" scope** can be customized for a specific index,  
  overriding the server-wide and the database configuration values.

- The "per-index" configuration key can be set from:
  - The [configuration tab](https://docs.ravendb.net/6.2/studio/database/indexes/create-map-index.md#configuration) in the Edit Index view in the Studio.
  - The [index class constructor](https://docs.ravendb.net/6.2/indexes/creating-and-deploying.md#creating-an-index-with-custom-configuration) when defining an index.
  - The [index definition](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/put-indexes.md#put-indexes-operation-with-indexdefinition) when sending a [putIndexesOperation](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/put-indexes.md).

**Expert configuration options**:

- [Server.IndexingAffinityMask](https://docs.ravendb.net/6.2/server/configuration/server-configuration.md#serverindexingaffinitymask) - Control the affinity mask of indexing threads
- [Server.NumberOfUnusedCoresByIndexes](https://docs.ravendb.net/6.2/server/configuration/server-configuration.md#servernumberofunusedcoresbyindexes) - Set the number of cores that *won't* be used by indexes
