Magento – Magento quick search results displaying all on one page

catalogsearchmagento-1.8

I'm currently developing a website for a client, which seems to have created a problem for itself… Or I have, but I can't figure out where or how?!

Basically, using the quick search, it will display all the results on the same page…. Even if there are 3,000 results!

The pagination is set up correctly, for both grid & list. The toolbar displays the amount of pages there should be, yet still displays all results on the single page.

Layered navigation is set up and showing.

I'm not sure if I'm allowed to display URL's on here, but if I am an example search is here: http://dev.cblsupplies.co.uk/catalogsearch/result/index/?cat=63&q=light

As you can, it's having a negative impact on performance due to the vast amount of results!

I'm really stumped on this one, I've searched and searched for a resolution – but I'm unable to find one. If anyone could point me in the right direction I'd be eternally grateful.

Best Answer

Most probably the toolbar block does not add limit to the sql query. For example because some other block load the collection before the toolbar.

Search for $collection->getSize();

Or similar method calls. At the background they may init sql query that returns not paginated results

Related Topic