2

I have more than 5K products. Suddenly don't know what happen now on Admin Side

In Admin -> Products -> Catalog now it's displaying only 1K products.

All Filters are also Reset. Visibility All Ok for Product.

When i Export from Admin .CSV file has 5K products. On Frontend also it's displaying 5K products.

Done with Indexing & Caching. Check Product Status as Well.

Don't know where is the issue?

[UPDATE]

I have delete all records & import it again. It's working fine now :)

14
  • 1K = 1000 products? Commented Oct 28, 2016 at 7:14
  • Yes @KhoaTruongDinh. You are right
    – Jackson
    Commented Oct 28, 2016 at 7:16
  • Do you have any error in you logs (magento, web server) or in your browser (JS console errors)?
    – Alex Gusev
    Commented Oct 28, 2016 at 7:29
  • Hi @AlexGusev No JS Error & Nothing in Log Checked. While ago it's working fine don't know what happened. So it stops displaying all records
    – Jackson
    Commented Oct 28, 2016 at 7:33
  • 1
    You have any custom related to vendor/magento/module-catalog-search/etc/search_request.xml? Commented Oct 28, 2016 at 10:26

1 Answer 1

0

Check SQL statement to get totals count. Change method \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory::create from

public function create(array $data = array())
{
    return $this->_objectManager->create($this->_instanceName, $data);
}

to

public function create(array $data = [])
{
    $collection = $this->_objectManager->create($this->_instanceName, $data);
    $sql = (string)$collection->getSelectCountSql();
    $logger = $this->_objectManager->get(\Psr\Log\LoggerInterface::class);
    $logger->alert($sql);
    return $collection;
}

then refresh your product grid and find SQL statement in the log (.../var/log/debug.log).

4
  • It's Magento Default vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php not able to find file & function @Alex
    – Jackson
    Commented Oct 28, 2016 at 10:42
  • Oh, sorry! This is autogenerated file. Look it for in .../var/generation/Magento/Catalog/Model/ResourceModel/Product/CollectionFactory.php.
    – Alex Gusev
    Commented Oct 28, 2016 at 10:56
  • In system.log 1] SELECT COUNT(DISTINCT e.entity_id) FROM catalog_product_entity AS e : 5K records 2] SELECT COUNT(DISTINCT e.entity_id) FROM catalog_product_entity AS e INNER JOIN search_tmp_5816a3c2c53281_43273028 AS search_result ON e.entity_id = search_result.entity_id It' saying temp table is not available
    – Jackson
    Commented Oct 31, 2016 at 1:56
  • 'tmp' table is from Full Text search indexation. Try to remove $this->_totalRecords = $this->searchResult->getTotalCount(); code from Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php (github.com/magento/magento2/pull/5641/files) This is not a real fix but probably helps to you. I have no ideas more :(
    – Alex Gusev
    Commented Oct 31, 2016 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.