Question

After having made a stormy migration from magento 1.8.1.0 to Magento 2.4.0 in the backend I can see all the categories and their products, however in the frontend when selecting any of the categories in the menu the products are not show, it is as if the category is empty. Please help

Was it helpful?

Solution 3

After almost going crazy looking for a solution finally thanks to the help of several people in this forum how I found how to do it:

1.- Elasticsearch was not installed on my server, I had to ask the provider to do it (take into account the correct version of Elasticsearch depending on your version of Magento 2.X).

2.- And this if it was the final solution, if not for this forum I would never have found it, here I leave them: (sorry I lost the link, but I had copied the answer :))

There are still some sorting problems when using an elastic search as a catalog search engine. To solve it, you can apply the following patch specifically to Magento 2.3.2 and Elasticsearch 6+.

Go to the file below and add a plugin in the class below. Vendor \ Magento \ module-elasticsearch \ Model \ ResourceModel \ Fulltext \ Collection \ SearchResultApplier.php

Find the apply () method and replace it with the following function. This is a hotfix introduced by Magento recently by adding $ this-> collection-> setPageSize (null); to the SearchResultApplier.php class

public function apply()
{
    if (empty($this->searchResult->getItems())) {
        $this->collection->getSelect()->where('NULL');
        return;
    }
    $ids = [];
    foreach ($this->searchResult->getItems() as $item) {
        $ids[] = (int)$item->getId();
    }
    $this->collection->setPageSize(null);
    $this->collection->getSelect()->where('e.entity_id IN (?)', $ids);
    $orderList = join(',', $ids);
    $this->collection->getSelect()->reset(\Magento\Framework\DB\Select::ORDER);
    $this->collection->getSelect()->order("FIELD(e.entity_id,$orderList)");
}

OTHER TIPS

Hello Josue,

Do check the Product Url rewrite, sometimes this issue occur after migration, or you can also check the Cron scheduling, is this on schedule or not, it take sometime after migration to stable, and also please do run the Re-indexing for all and then check

It will help you out, these are the highlighted point according to your issue!

Thanks

Munesh.

From the 2.4 version of Magento you need to use elastic search. Please navigate: admin => config => catalog => catalog search and choose elastic search 7 Click 'Test connection' to see if it appears success or not. If it does, reindex. If it doesn't, restart Elastic search and config to the right port and retry.

Hope that help!

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top