It was due to upgrading Magento version via git or others.
Also, it is known as Magento 2.1.3/2.1.4/2.1.5 issue.
This is accurate solution.
We can easily add these two files on original Modules folder.
app\code\Modules\Catalog\etc\di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Catalog\Model\Indexer\Category\Product\Action\Full" type="Modules\Catalog\Model\Indexer\Category\Product\Action\Full" />
</config>
app\code\Modules\Catalog\Model\Indexer\Category\Product\Action\Full.php
<?php
namespace Modules\Catalog\Model\Indexer\Category\Product\Action;
/**
* Class AbstractAction
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Full extends \Magento\Catalog\Model\Indexer\Category\Product\Action\Full {
public function isRangingNeeded() {
return false; // It was "True" as default setting.
}
}
Then, we should run this command.
php bin/magento cache:clean
php bin/magento indexer:reindex
Finally, we got whole 2000 products on our category page instead of previous 340 products on frontend page.
Also, the "Product category" tab on index management is just updated from date of version upgraded to current indexing date and time.
Hope this will help many developers and owners.