You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: guides/v2.2/extension-dev-guide/indexing-custom.md
+49-8Lines changed: 49 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -23,16 +23,57 @@ Your custom indexer class should implement [\Magento\Framework\Indexer\ActionInt
23
23
24
24
### Indexer configuration
25
25
26
-
In the `etc` directory of your module, add `indexer.xml` with the following:
26
+
Declare a new indexer process in the `etc/indexer.xml`file with the following attributes:
27
27
28
-
* indexer ID
29
-
* indexer class name
30
-
* indexer title
31
-
* indexer description
32
-
* indexer view ID
33
-
* shared indexes, if any
28
+
| Attribute | Required? | Description |
29
+
| --- | --- | --- |
30
+
|`id`| Yes | A unique indexer ID |
31
+
|`class`| No | The class that processes indexer methods (`executeFull`, `executeList`, `executeRow`) |
32
+
|`primary`| No | The source provider |
33
+
|`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. |
34
+
|`view_id`| No | The ID of the view element that is defined in the `mview.xml` configuration file. |
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.
47
+
An indexer process can also have the following optional parameters:
48
+
49
+
| Parameter | Description |
50
+
| --- | --- |
51
+
|`description`| The description of indexer to be displayed on the `System` > `Tools` > `Index Management` page. |
52
+
|`fieldset`| Describes the fields, source, and data provider of the flat index table. |
53
+
|`saveHandler`| An extension point. The class for processing (deleting, saving, updating) items when indexing. |
54
+
|`structure`| The class that processes (creates, removes) flat index tables. |
55
+
|`title`| The title of indexer to be displayed on the `System` > `Tools` > `Index Management` page. |
0 commit comments