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

# Get Index Operation

> Client language: Python. Also available for [C#](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/get-index.md), [Java](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/get-index.java.md), [PHP](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/get-index.php.md), [Node.js](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/get-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**
>
> - Use `GetIndexOperation` to retrieve an index definition from the database.
>
> - The operation will execute on the node defined by the [client configuration](https://docs.ravendb.net/6.2/client-api/configuration/load-balance/overview.md#client-logic-for-choosing-a-node).  
>   However, the index definition returned is taken from the database record,  
>   which is common to all the database-group nodes.  
>   i.e., an index state change done only on a local node is not reflected.
>
> - To get the index state on the local node use `GetIndexStatisticsOperation`.
>
> - In this page:
>   - [Get Index example](#get-index-example)
>   - [Syntax](#syntax)

## Get Index example

```python
# Define the get index operation, pass the index name
get_index_op = GetIndexOperation("Orders/Totals")

# Execute the operation by passing it to maintenance.send
index = store.maintenance.send(get_index_op)

# Access the index definition
state = index.state
lock_mode = index.lock_mode
deployment_mode = index.deployment_mode
# etc.
```

## Syntax

```python
class GetIndexOperation(MaintenanceOperation[IndexDefinition]):
  def __init__(self, index_name: str): ...
```

| Parameters | Type | Description |
| - | - | - |
| **index\_name** | `str` | Name of index to get |

| Return value of `store.maintenance.send(GetIndexOperation)` | Description |
| - | - |
| `IndexDefinition` | An instance of class [IndexDefinition](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/put-indexes.python.md#indexdefinition) |

## 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)
- [How to Get Indexes](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/get-indexes.python.md)
- [How to Put Indexes](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/put-indexes.python.md)
- [How to Delete Index](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/delete-index.python.md)
