---
title: "Disable Index"
url: "https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/disable-index"
version: "6.2"
language: "python"
---

# Disable Index

> Client language: Python. Also available for [C#](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/disable-index.md), [Java](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/disable-index.java.md), [PHP](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/disable-index.php.md), [Node.js](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/disable-index.nodejs.md).
>
> 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."

> **Note**
>
> - You can **disable a specific index** by either of the following:
>   - From the Client API - using `DisableIndexOperation`
>   - From Studio - see [indexes list view](https://docs.ravendb.net/6.2/studio/database/indexes/indexes-list-view.md#indexes-list-view---actions)
>   - Via the file system
>
> - To learn how to enable a disabled index, see [Enable index operation](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/enable-index.python.md).
>
> - In this page:
>
>   - [Overview](#overview)
>     - [Which node is the index disabled on?](#which-node-is-the-index-disabled-on)
>     - [What happens when the index is disabled?](#what-happens-when-the-index-is-disabled)
>
>   - [Disable index from the Client API](#disable-index-from-the-client-api)
>     - [Disable index - single node](#disable-index---single-node)
>     - [Disable index - cluster wide](#disable-index---cluster-wide)
>     - [Syntax](#syntax)
>
>   - [Disable index manually via the file system](#disable-index-manually-via-the-file-system)

## Overview

#### Which node is the index disabled on?

- The index can be disabled either:
  - On a single node, or
  - Cluster wide - on all database-group nodes.

- When disabling the index from the **client API** on a single node:  
  The index will be disabled on the [preferred node](https://docs.ravendb.net/6.2/client-api/configuration/load-balance/overview.md#the-preferred-node) only, and Not on all the database-group nodes.

- When disabling an index from the **Studio** [indexes list](https://docs.ravendb.net/6.2/studio/database/indexes/indexes-list-view.md#indexes-list-view---actions) view:  
  The index will be disabled on the local node the browser is opened on, even if it is Not the preferred node.

- When disabling the index [manually](#disable-index-via-the-file-system):  
  The index will be disabled on the [preferred node](https://docs.ravendb.net/6.2/client-api/configuration/load-balance/overview.md#the-preferred-node) only, and Not on all the database-group nodes.

#### What happens when the index is disabled?

- No indexing will be done by a disabled index on the node where index is disabled.  
  However, new data will be indexed by the index on other database-group nodes where it is not disabled.

- You can still query the index,  
  but results may be stale when querying a node on which the index was disabled.

- Disabling an index is a **persistent operation**:
  - The index will remain disabled even after restarting the server or after [disabling/enabling](https://docs.ravendb.net/6.2/client-api/operations/server-wide/toggle-databases-state.python.md) the database.
  - To only pause the index and resume after a restart see: [pause index operation](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/stop-index.python.md).

## Disable index from the Client API

#### Disable index - single node:

```python
# Define the disable index operation
# Use this args set to disable on a single node
disable_index_op = DisableIndexOperation("Orders/Totals")

# Execute the operation by passing it to maintenance.send
store.maintenance.send(disable_index_op)

# At this point, the index is disabled only on the 'preferred node'
# New data will not be indexed on this node only
```

#### Disable index - cluster wide:

```python
# Define the disable index operation
# Pass 'True' to disable the index on all nodes in the database-group
disable_index_op = DisableIndexOperation("Orders/Totals", True)

# Execute the operation by passing it to maintenance.send
store.maintenance.send(disable_index_op)

# At this point, the index is disabled on ALL nodes
# New data will not be indexed
```

#### Syntax:

```python
class DisableIndexOperation(VoidMaintenanceOperation):
  def __init__(self, index_name: str, cluster_wide: bool = False): ...
```

| Parameter | Type | Description |
| - | - | - |
| **index\_name** | `str` | Name of index to disable |
| **cluster\_wide** | `bool` | `True` - Disable index on all database-group nodes<br />`False` - Disable index only on a single node (the preferred node) |

## Disable index manually via the file system

- It may sometimes be useful to disable an index manually, through the file system.  
  For example, a faulty index may load before [DisableIndexOperation](#disableindexoperation) gets a chance to disable it.  
  Manually disabling the index will ensure that the index is not loaded.

- To **manually disable** an index:

  - Place a file named `disable.marker` in the [index directory](https://docs.ravendb.net/6.2/server/storage/directory-structure.md).  
    Indexes are kept under the database directory, each index in a directory whose name is similar to the index's.
  - The `disable.marker` file can be empty,  
    and can be created by any available method, e.g. using the File Explorer, a terminal, or code.

- Attempting to use a manually disabled index will generate the following exception:

  Unable to open index: '{IndexName}',
  it has been manually disabled via the file: '{disableMarkerPath}'.  
  To re-enable, remove the disable.marker file and enable indexing.\`

- To **enable** a manually disabled index:

  - First, remove the `disable.marker` file from the index directory.
  - Then, enable the index by any of the options described in: [How to enable an index](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/enable-index.python.md#how-to-enable-an-index).

## See also

- [What are Indexes](https://docs.ravendb.net/6.2/indexes/what-are-indexes.python.md)
- [Creating and Deploying Indexes](https://docs.ravendb.net/6.2/indexes/creating-and-deploying.md)
- [Index Administration](https://docs.ravendb.net/6.2/indexes/index-administration.md)
- [Enable Index](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/enable-index.python.md)
- [What are operations](https://docs.ravendb.net/6.2/client-api/operations/what-are-operations.python.md)
- [How to Pause Index Until Restart](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/stop-index.python.md)
