|
1 |
| -## Overview |
2 |
| -Magento_Indexer module is a base of Magento Indexing functionality. |
3 |
| -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, |
| 1 | +# Magento_Indexer module |
| 2 | + |
| 3 | +This module provides Magento Indexing functionality. |
| 4 | +It allows to: |
| 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 `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 `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 `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 layout handles 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 | +### Indexer modes |
| 69 | + |
| 70 | +There are 2 modes of the Indexers: |
| 71 | + |
| 72 | +- Update on Save - index tables are updated immediately after the dictionary data is changed |
| 73 | +- Update by Schedule - index tables are updated by cron job according to the configured schedule |
| 74 | + |
| 75 | +### Console commands |
| 76 | + |
| 77 | +Magento_Indexers provides console commands: |
| 78 | +- `bin/magento indexer:info` - view a list of all indexers |
| 79 | +- `bin/magento indexer:status [indexer]` - view index status |
| 80 | +- `bin/magento indexer:reindex [indexer]` - run reindex |
| 81 | +- `bin/magento indexer:reset [indexer]` - reset indexers |
| 82 | +- `bin/magento indexer:show-mode [indexer]` - view the current indexer configuration |
| 83 | +- `bin/magento indexer:set-mode {realtime|schedule} [indexer]` - specify the indexer configuration |
| 84 | +- `bin/magento indexer:set-dimensions-mode [indexer]` - set indexer dimension mode |
| 85 | +- `bin/magento indexer:show-dimensions-mode [indexer]` - set indexer dimension mode |
| 86 | + |
| 87 | +### Cron options |
| 88 | + |
| 89 | +Cron group configuration can be set at `etc/crontab.xml`: |
| 90 | +- `indexer_reindex_all_invalid` - regenerate indexes for all invalid indexers |
| 91 | +- `indexer_update_all_views` - update indexer views |
| 92 | +- `indexer_clean_all_changelogs` - clean indexer view changelogs |
| 93 | + |
| 94 | +[Learn how to configure and run cron in Magento.](http://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cron.html). |
| 95 | + |
| 96 | +More information can get at articles: |
| 97 | +- [Learn more about indexing](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/indexing.html) |
| 98 | +- [Learn more about Indexer optimization](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/indexer-batch.html) |
| 99 | +- [Learn more how to add custom indexer](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/indexing-custom.html) |
| 100 | +- [Learn how to manage indexers](https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-index.html) |
| 101 | +- [Learn more about Index Management](https://docs.magento.com/user-guide/system/index-management.html) |
0 commit comments