Title: magento 2 layered navigation count change every time
Tags: php;magento;magento2
Question: When I am on the products page the products in the filter is displayed randomly
I try to reindex all my products category with
php bin/magento indexer:reindex
and flush my cache
bin/magento cache:flush
in my templete list.phtml I will search in my database the products with this code
$_productCollection = $block-&gt;getLoadedProductCollection()-&gt;clear()-&gt;addAttributeToSort('name', 'ASC');
$_helper = $this-&gt;helper('Magento\Catalog\Helper\Output');
$objectManager= \Magento\Framework\App\ObjectManager75b5:f2c1:f5d7:b954:8dc3:cee9:baf:a8c0getInstance();
$eavConfig= $objectManager-&gt;create('\Magento\Eav\Model\Config');
$attribute = $eavConfig-&gt;getAttribute('catalog_product', 'code_fini_mat');
$options = $attribute-&gt;getSource()-&gt;getAllOptions();
Comment: you mean to say it show random count?

Comment: Can you verify it show properly in admin?

Comment: yes the number is random



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 3, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2017:00:02/03/17', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<php><magento><magento2>', 'Title': 'magento 2 layered navigation count change every time', 'ViewCount': 221, 'id': 42028334, 'user_AboutMe': '<p>i am programmer php , javascript , and python</p>\n', 'user_AccountId': 9348795.0, 'user_DisplayName': 'john', 'user_Reputation': 468.0, 'user_Views': 107.0, 'user_id': 6939208.0}}