![]() |
VOOZH | about |
This document covers the CLI commands available for managing Maho's indexing system. These commands allow administrators to list, reindex, and monitor index processes from the command line. For information about the underlying indexing architecture and how indexers work internally, see Indexing System. For general CLI architecture, see CLI Architecture.
Maho provides several index management commands for operational control over the indexing system. These commands are registered in the main maho entry point maho53-56
| Command | Purpose | Typical Usage |
|---|---|---|
index:list | Display all configured indexes and their status | Monitoring and diagnostics |
index:reindex | Reindex a single index by code | Targeted reindexing after data changes |
index:reindex:all | Reindex all indexes sequentially | Full system reindexing |
index:reindex:product | Reindex product-related indexes | Product catalog updates |
All index commands extend BaseMahoCommand lib/MahoCLI/Commands/BaseMahoCommand.php18-19 and initialize the Maho application in admin mode before execution via initMaho() lib/MahoCLI/Commands/BaseMahoCommand.php20-24
Sources: maho53-56 lib/MahoCLI/Commands/BaseMahoCommand.php18-24
The index commands are registered in the Maho CLI entry point and interact with the Mage_Index module models.
The following diagram bridges the natural language commands to the specific PHP classes and methods responsible for execution.
CLI to Code Entity Space
Sources: maho53-56 lib/MahoCLI/Commands/BaseMahoCommand.php18-24 lib/MahoCLI/Commands/IndexReindex.php48 lib/MahoCLI/Commands/IndexReindexAll.php38
The index:list command displays all configured indexes with their current status, execution timestamps, and mode settings.
The command retrieves the index process collection and outputs a formatted table with index metadata.
Execution Sequence
The debug() method on the process model returns an associative array containing the indexer code, status, timestamps, and execution mode lib/MahoCLI/Commands/IndexList.php36-39
Sources: lib/MahoCLI/Commands/IndexList.php29-44
The index:reindex command reindexes a single index identified by its unique code (e.g., catalog_product_price).
| Argument | Type | Required | Description |
|---|---|---|---|
index_code | string | Yes | The code of the index to process |
initMaho() to set up the admin environment lib/MahoCLI/Commands/IndexReindex.php37Mage::getModel('index/indexer')->getProcessByCode($indexCode) lib/MahoCLI/Commands/IndexReindex.php40$index->reindexEverything() lib/MahoCLI/Commands/IndexReindex.php46-50Sources: lib/MahoCLI/Commands/IndexReindex.php29-53
The index:reindex:all command reindexes every configured index sequentially.
The command iterates through the Mage_Index_Model_Resource_Process_Collection. For each process, it executes reindexEverything() and reports the individual duration lib/MahoCLI/Commands/IndexReindexAll.php32-41 Finally, it outputs the total duration for all indexing tasks lib/MahoCLI/Commands/IndexReindexAll.php43-45
Sources: lib/MahoCLI/Commands/IndexReindexAll.php28-48
If search results are inconsistent, rebuild the fulltext index:
Typically performed during deployment or after large data imports:
Sources: lib/MahoCLI/Commands/IndexList.php24 lib/MahoCLI/Commands/IndexReindex.php24 lib/MahoCLI/Commands/IndexReindexAll.php23
Refresh this wiki