Get Index Operation


  • Use GetIndexOperation to retrieve an index definition from the database.

  • The operation will execute on the node defined by the client configuration.
    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

# 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

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