Get Indexes Operation
-
Use
GetIndexesOperation
to retrieve multiple index definitions from the database. -
The operation will execute on the node defined by the client configuration.
However, the index definitions returned are 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 a specific index state on a local node use
GetIndexStatisticsOperation
. -
In this page:
Get Indexes example
// Define the get indexes operation
// Pass number of indexes to skip & number of indexes to retrieve
$getIndexesOp = new GetIndexesOperation(0, 10);
// Execute the operation by passing it to Maintenance.Send
/** @var IndexDefinitionArray $indexes */
$indexes = $store->maintenance()->send($getIndexesOp);
// indexes will contain the first 10 indexes, alphabetically ordered by index name
// Access an index definition from the resulting list:
$name = $indexes[0]->getName();
$state = $indexes[0]->getState();
$lockMode = $indexes[0]->getLockMode();
$deploymentMode = $indexes[0]->getDeploymentMode();
// etc.
Syntax
GetIndexesOperation(int $start, int $pageSize)
Parameters | Type | Description |
---|---|---|
$start | int |
Number of indexes to skip |
$pageSize | int |
Number of indexes to retrieve |