My site has more than 100.000 products and almost 20 storeviews. Each time I run a full reindexing, it takes about 10 hours for reindexing to be finished.
I wonder if it's possible to just run reindexing for a specific storeview?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityThere is no direct way to do this. But you may be approaching it from the wrong angle anyway.
In normal operation you shouldn't have to do a full reindex at any time. If you have the indexing mode set to schedule, triggers in the database will create records in the _cl (changelog) tables on data modification.
The mview_state table keeps track of which changes have been handled so far.
The indexer cron jobs (indexer_reindex_all_invalid) which normally runs every minute / 5 minutes. Will automatically reindex all the pending changes - and clear the caches of those specific items.
So you won't have to ever do a full reindex. If you switch the indexer mode to realtime (Update on save). The triggers get removed from the database and magento will trigger reindexing and cache clearing on save. This is extremely bad, because it will do a full reindex / cache clear on the save of a single product/category/etc. This is behavior you (almost) never want to have.
So my advice would be:
bin/magento indexer:set-mode schedule
)bin/magento indexer:set-mode realtime
, reset the index bin/magento indexer:reset
, run the reindex, then switch back to schedule mode.bin/magento cron:run
)John Hughes has an excellent talk on this subject at magento conferences. You can read his presentation sheets here. It's really insightful stuff, and well worth a read: