cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.4 showing all results on search page and ignores pagination

SOLVED

Magento 2.4 showing all results on search page and ignores pagination

It seems that this problem exists in previous versions of Magento, but I haven't found the solution for version CE 2.4.

I use Elasticsearch 7, and no matter what I search for I always get all results displayed (which usually takes very long when there are hundreds or thousands of results).

First I thought that it could be something related to the theme that we are using, but it happens even when we use Magento Luma theme.

Is there a solution to this? I could not find a useful one for 2.4...  

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Magento 2.4 showing all results on search page and ignores pagination

After digging in for hours. Clean Magento 2.4 CE is working find without this error (no other extension installed). In my case, one of the extension (custom one - from marketplace) causing this problem, and everything ok after it is disabled.

View solution in original post

Re: Magento 2.4 showing all results on search page and ignores pagination

I finally figured out the problem in my case - it was Mageplaza Google Tag Manager v4.0.0 extension that was creating a problem. After disabling it all started to work properly. Thank you for your help!

View solution in original post

9 REPLIES 9

Re: Magento 2.4 showing all results on search page and ignores pagination

@predragsto51a5 ,

Log in to the Magento Admin as an administrator.

 

Click Stores > Settings > Configuration > Catalog > Catalog > Catalog Search.

 

and switch Search Engine to Mysql 

after that reset and reindex using 

php bin/magento indexer:reset

php bin/magento indexer:reindex

kindly check if that works.

 

Re: Magento 2.4 showing all results on search page and ignores pagination

This definitely can't be the solution. First of all MySQL is not what you want to use as full text search engine. Second of all - Magento 2.4 does not support MySQL as a search option. Only Elasticsearch is supported.

Re: Magento 2.4 showing all results on search page and ignores pagination

Did you find a fix for this? I have the same issue on a couple of sites.

 

This one was a brand new install https://www.pawsitivelypets.co.uk/dogs.html neither pagination or sorting seems to work, I've tried turning off all extensions too.

 

Do you see the same behaviour as this?

Re: Magento 2.4 showing all results on search page and ignores pagination

Same problem found after upgrade to 2.4CE

It is not a template problem, did test on multiple templates, even on Magento Luna.

It is not Elasticsearch 6.X or 7.X problem, tested on 6.X or 7.X. I know 6.X is deprecated on 2.4CE but it is still work if you select it.

 

People do search and load hundred of products on search results all on 1 page. It is a bug that easily get server crashed.

Re: Magento 2.4 showing all results on search page and ignores pagination

After digging in for hours. Clean Magento 2.4 CE is working find without this error (no other extension installed). In my case, one of the extension (custom one - from marketplace) causing this problem, and everything ok after it is disabled.

Re: Magento 2.4 showing all results on search page and ignores pagination

I finally figured out the problem in my case - it was Mageplaza Google Tag Manager v4.0.0 extension that was creating a problem. After disabling it all started to work properly. Thank you for your help!

Re: Magento 2.4 showing all results on search page and ignores pagination

it's elastic problem, on debian you need to do:

/etc/init.d/elasticsearch stop

rm -rf /var/lib/elasticsearch/nodes

/usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-phonetic

/usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-icu

/etc/init.d/elasticsearch start

bin/magento index:reindex

 

check also you have installed elasticsearch 7.0 not 6.0

Re: Magento 2.4 showing all results on search page and ignores pagination

Thank you @Franky_L. I got the same problem on my environment and found that the root cause of this problem is due to the loading sequence of the xml layout. This extension put a template inside container "after.body.start" and the template will try to initialize product collection from the xml block "search_result_list". It will run earlier than the search result block and break the pagination on search result page. To fix it, you can try to move the template from "after.body.start" to other place like "footer".

Re: Magento 2.4 showing all results on search page and ignores pagination

If you are using Porto theme then it should be a problem...