|
1 |
| -## Overview |
2 |
| -Magento_Indexer module is a base of Magento Indexing functionality. |
| 1 | +# Magento_Indexer module |
| 2 | + |
| 3 | +This module provides Magento Indexing functionality. |
3 | 4 | It allows:
|
4 |
| - - read indexers configuration, |
5 |
| - - represent indexers in admin, |
6 |
| - - regenerate indexes by cron schedule, |
7 |
| - - regenerate indexes from console, |
8 |
| - - view and reset indexer state from console, |
| 5 | + - read indexers configuration |
| 6 | + - represent indexers in admin |
| 7 | + - regenerate indexes by cron schedule |
| 8 | + - regenerate indexes from console |
| 9 | + - view and reset indexer state from console |
9 | 10 | - view and set indexer mode from console
|
10 | 11 |
|
11 |
| -There are 2 modes of the Indexers: "Update on save" and "Update by schedule". |
12 |
| -Manual full reindex can be performed via console by running `php -f bin/magento indexer:reindex` console command. |
| 12 | +## Installation |
| 13 | + |
| 14 | +The Magento_Indexer module is one of the base Magento 2 modules. You cannot disable or uninstall this module. |
| 15 | + |
| 16 | +This module is dependent on the following modules: |
| 17 | + |
| 18 | +- `Magento_Store` |
| 19 | +- `Magento_AdminNotification` |
| 20 | + |
| 21 | +The Magento_Indexer module creates the following tables in the database: |
| 22 | +- `indexer_state` |
| 23 | +- `mview_state` |
| 24 | + |
| 25 | +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). |
| 26 | + |
| 27 | +## Structure |
| 28 | + |
| 29 | +`App/` - the directory that contains launch application entry point. |
| 30 | + |
| 31 | +For information about a typical file structure of a module in Magento 2, see [Module file structure](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). |
| 32 | + |
| 33 | +## Extensibility |
| 34 | + |
| 35 | +Extension developers can interact with the Magento_Indexer module. For more information about the Magento extension mechanism, see [Magento plugins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). |
| 36 | + |
| 37 | +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Indexer module. |
| 38 | + |
| 39 | +### Events |
| 40 | + |
| 41 | +The module dispatches the following events: |
| 42 | + |
| 43 | +#### Model |
| 44 | + |
| 45 | +- `clean_cache_by_tags` event in the `\Magento\Indexer\Model\Indexer\CacheCleaner::cleanCache` method. Parameters: |
| 46 | + - `object` is a `$this->cacheContext` object (`Magento\Framework\Indexer\CacheContext` class) |
| 47 | + |
| 48 | +#### Plugin |
| 49 | + |
| 50 | +- `clean_cache_after_reindex` event in the `\Magento\Indexer\Model\Processor\CleanCache::afterUpdateMview` method. Parameters: |
| 51 | + - `object` is a `$this->context` object (`Magento\Framework\Indexer\CacheContext` class) |
| 52 | + |
| 53 | +- `clean_cache_by_tags` event in the `\Magento\Indexer\Model\Processor\CleanCache::afterReindexAllInvalid` method. Parameters: |
| 54 | + - `object` is a `$this->context` object (`Magento\Framework\Indexer\CacheContext` class) |
| 55 | + |
| 56 | +For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). |
| 57 | + |
| 58 | +### Layouts |
| 59 | + |
| 60 | +This module introduces the following layouts in the `view/adminhtml/layout` directory: |
| 61 | +- `indexer_indexer_list` |
| 62 | +- `indexer_indexer_list_grid` |
| 63 | + |
| 64 | +For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). |
| 65 | + |
| 66 | +## Additional information |
| 67 | + |
| 68 | +### Magento indexers |
| 69 | + |
| 70 | +List of Magento default indexers: |
| 71 | +- `design_config_grid` - Design Config Grid |
| 72 | +- `customer_grid` - Customer Grid |
| 73 | +- `catalog_category_product` - Category Products |
| 74 | +- `catalog_product_category` - Product Categories |
| 75 | +- `catalogrule_rule` - Catalog Rule Product |
| 76 | +- `catalog_product_attribute` - Product EAV |
| 77 | +- `catalogrule_product` - Catalog Product Rule |
| 78 | +- `cataloginventory_stock` - Stock |
| 79 | +- `catalog_product_price` - Product Price |
| 80 | +- `catalogsearch_fulltext` - Catalog Search |
| 81 | + |
| 82 | +### Indexer modes |
| 83 | + |
| 84 | +There are 2 modes of the Indexers: |
| 85 | + |
| 86 | +- Update on Save - index tables are updated immediately after the dictionary data is changed |
| 87 | +- Update by Schedule - index tables are updated by cron job according to the configured schedule |
| 88 | + |
| 89 | +### Console commands |
| 90 | + |
| 91 | +Magento_Indexers provides console commands: |
| 92 | +- `bin/magento indexer:info` - view a list of all indexers |
| 93 | +- `bin/magento indexer:status [indexer]` - view index status |
| 94 | +- `bin/magento indexer:info` - view list all indexers |
| 95 | +- `bin/magento indexer:reindex [indexer]` - run reindex |
| 96 | +- `bin/magento indexer:reset [indexer]` - reset indexers |
| 97 | +- `bin/magento indexer:show-mode [indexer]` - view the current indexer configuration |
| 98 | +- `bin/magento indexer:set-mode {realtime|schedule} [indexer]` - specify the indexer configuration |
| 99 | + |
| 100 | +### Cron options |
| 101 | + |
| 102 | +Cron group configuration can be set at `etc/crontab.xml`: |
| 103 | +- `indexer_reindex_all_invalid` - regenerate indexes for all invalid indexers |
| 104 | +- `indexer_update_all_views` - update indexer views |
| 105 | +- `indexer_clean_all_changelogs` - clean indexer view changelogs |
| 106 | + |
| 107 | +[Learn how to configure and run cron in Magento.](http://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cron.html). |
| 108 | + |
| 109 | +More information can get at articles: |
| 110 | +- [Learn more about indexing](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/indexing.html) |
| 111 | +- [Learn more about Indexr optimization](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/indexer-batch.html) |
| 112 | +- [Learn more how to add custom indexer](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/indexing-custom.html) |
| 113 | +- [Learn how to manage indexers](https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-index.html) |
| 114 | +- [Learn more about Index Management](https://docs.magento.com/user-guide/system/index-management.html) |
0 commit comments