Magento – Magento 2.1.5: Products Missing in Categories after Reindex

categoryinventorymagento-2.1productsreindex

I am running Magento 2.1.5 and facing a really strange issue. I have over 6,500 products uploaded to the store but some items are not showing up after performing a complete reindex. Of course, some items are out of stock but many of the products that are not showing up in their respective categories are the similar as others that are showing up just fine. These products are simple (not configurable) and belong to do the same attribute group.

Upon searching for the items in search the missing products show up. Upon saving the item the item appears again only to go missing again upon reindex.

After performing reindex one by one, I noticed the issue is affecting the following tables:

catalog_category_product
catalog_product_category

I even went ahead and added a row which made the product appear again on the front-end but after reindexing the row was deleted.

Does anyone have any clue as to what this issue could be? It's very, very strange but I'm hoping there is a simple solution.

Update 02/27/2017: I am still not able figure out a solution for this bug. If any Magento Expert can gain some insight into this and fix it he or she will be rewarded.

Best Answer

Seem that we need to increase the memory limit when running re-index a large of number database:

1) Reset db: open your PHP Admin or Mysql GUI tool

update indexer_state set status = 'invalid' where status != 'valid';

2) Re-index again:

php -dmemory_limit=2048M bin/magento indexer:reindex
Related Topic