i have a custom módule with his own indexer. I need that when i execute it (indexer:reindex custom_index), some indexes runs after.

There is an example with the "catalogrule_rule" indexer.

bin/magento indexer:reindex catalogrule_rule
Catalog Rule Product index has been rebuilt successfully in 00:00:02
Product Price index has been rebuilt successfully in 00:00:01
Catalog Search index has been rebuilt successfully in 00:00:45

Here is my mview.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd">
<view id="custom_index" class="My\Module\Model\Indexer\CustomIndexer" group="indexer">
        <table name="custom_table" entity_column="entity_id" />

Here is my indexer.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd">
<indexer id="custom_index" view_id="custom_index" class="My\Module\Model\Indexer\CustomIndexer" shared_index="custom_index">
    <title translate="true">Custom indexer</title>
    <description translate="true">Custom description</description>
<indexer id="catalogrule_rule">
        <indexer id="custom_index" />

But, when i run setup:upgrade, i find this error...

Module 'Magento_Eav':
Module 'Magento_Directory':
Module 'Magento_Customer':
Module 'Magento_Theme':
Module 'Magento_Indexer':
Running schema recurring...Invalid Document 
Element 'title': This element is not expected.
Line: 10
  • I think you have problem in another xml file :) – dudzio Dec 21 '19 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.