Magento 2 - Vue Storefront PWA Integration: How to create a new VSBridge indexer job and Elastic Index for your custom module

For this tutorial we will consider an example of a custom module called Vendor_ModuleName . You need to have the module divante/magento2-vsbridge-indexer installed and configured in your project, in order for it to work with your Vue StoreFront PWA website. You can do this with below command:
Once you have the module installed and configured correctly, create below files to generate a new VSBridge indexer and Elastic Index for your own module: Vendor_ModuleName\etc\indexer.xml

Vendor_ModuleName\etc\mview.xml

Vendor_ModuleName\etc\vsbridge_indices.xml

Vendor\ModuleName\Model\Indexer\CustomIndexer.php

Vendor\ModuleName\Model\Indexer\Mapping\CustomIndexer.php

Vendor\ModuleName\etc\di.xml

Now, open console and run below command:
You will now see following:
  • A new indexer job for your module in Magento admin panel > System > Tools > Index Management
  • A new index in elastic
  • You can refresh your indexer with
    php bin/magento indexer:reindex vsbridge_my_custom_indexer

Comments

Popular posts from this blog

XDebug - PHPStorm - Mac: How to configure Xdebug with PHPStorm on Mac OS and PHP 7.3