ou can find a fix in Magento 2 GitHub. The issue is present on 2.1.5.
https://github.com/magento/magento2/issues/8018
One of the soulution is to add a preference
<preference for="Magento\Catalog\Model\Indexer\Category\Product\Action\Full" type="<My>\<Module>\Model\Indexer\Category\Product\Action\Full" />
And override the limit of 500 product while reindex.
<?phpnamespace <My>\<Module>\Model\Indexer\Category\Product\Action; /* * Need to override this because ranging is limiting the original indexer to 500 rows per category * */ class Full extends \Magento\Catalog\Model\Indexer\Category\Product\Action\Full{ protected function isRangingNeeded() { return false; } }
Hope this help you.