Magento 2 Single Store Flat Index

Sometimes you want to test an update in the Flat Catalog on your development environment, but when you have several storeviews with many products you have to wait a very long time for the Flat Catalog Index.

It is possible to add just one line of code temporary to the index process so it only runs for one storeview.

This one line of code will give you more development time!

 

Manually Reindex Flat Product for a Single Storeview

It is possible to only run catalog_product_flat for only one storeview

Edit the function execute in vendor/magento/module-catalog/Model/Indexer/Product/Flat/Action/Full.php

Change the function from:

to:

 

Now re-run the following command

If you want to do the same for the catalogsearch_fulltext index

And for the catalog_category_flat the same trick