diff --git a/guides/v2.2/extension-dev-guide/indexing-custom.md b/guides/v2.2/extension-dev-guide/indexing-custom.md index 9c472b5f51b..58aa95ecb67 100644 --- a/guides/v2.2/extension-dev-guide/indexing-custom.md +++ b/guides/v2.2/extension-dev-guide/indexing-custom.md @@ -23,16 +23,57 @@ Your custom indexer class should implement [\Magento\Framework\Indexer\ActionInt ### Indexer configuration -In the `etc` directory of your module, add `indexer.xml` with the following: +Declare a new indexer process in the `etc/indexer.xml` file with the following attributes: -* indexer ID -* indexer class name -* indexer title -* indexer description -* indexer view ID -* shared indexes, if any +| Attribute | Required? | Description | +| --- | --- | --- | +| `id` | Yes | A unique indexer ID | +| `class` | No | The class that processes indexer methods (`executeFull`, `executeList`, `executeRow`) | +| `primary` | No | The source provider | +| `shared_index` | No | Use this option to improve performance if your indexer is related to another indexer. In this [example]({{ site.mage2bloburl }}/{{ page.guide_version }}/app/code/Magento/CatalogRule/etc/indexer.xml), if the Catalog Product Rule index needs to be reindexed, but other catalog product rule indexes are up-to-date, then only the Catalog Product Rule is reindexed. | +| `view_id` | No | The ID of the view element that is defined in the `mview.xml` configuration file. | + +For example, + +```xml + + + + ... + + +``` -Use the optional `shared_index=` parameter to improve performance if your indexer is related to another indexer. In this [example]({{ site.mage2bloburl }}/{{ page.guide_version }}/app/code/Magento/CatalogRule/etc/indexer.xml){:target="_blank"}, if [catalog](https://glossary.magento.com/catalog) rule product needs to be reindexed, but other catalog product rule index is up-to-date, then only catalog rule product is reindexed. +An indexer process can also have the following optional parameters: + +| Parameter | Description | +| --- | --- | +| `description` | The description of indexer to be displayed on the `System` > `Tools` > `Index Management` page. | +| `fieldset` | Describes the fields, source, and data provider of the flat index table. | +| `saveHandler` | An extension point. The class for processing (deleting, saving, updating) items when indexing. | +| `structure` | The class that processes (creates, removes) flat index tables. | +| `title` | The title of indexer to be displayed on the `System` > `Tools` > `Index Management` page. | + +For example: + +```xml + + + + Design Config Grid + Rebuild design config grid index + +
+ + + +
+ + +
+
+``` All indexers related to a [module](https://glossary.magento.com/module) should be declared in one file.