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
$getIndexOp = new GetIndexOperation("Orders/Totals");
// Execute the operation by passing it to Maintenance.Send
/** @var IndexDefinition $index */
$index = $store->maintenance()->send($getIndexOp);
// Access the index definition
$state = $index->getState();
$lockMode = $index->getLockMode();
$deploymentMode = $index->getDeploymentMode();
// etc.
Syntax
GetIndexOperation(?string $indexName)
Parameters | Type | Description |
---|---|---|
$indexName | ?string |
Name of index to get |