Fix: Magento Catalog Search Broken / Not Working

Written by Gordon

Topics: Magento

We recently updated a Magento install from to Everything worked fine, expect the search function. Whatever we searched for, the site returned just one result. This seems to be a problem with upgrades and even some fresh installs of Magneto, 1.4.2,, etc. The following is the fix. This will require fixing the core files. Hopefully the Magento team will address the issue in the next update.

Edit app/code/core/Mage/CatalogSearch/Block/Result.php

Uncomment lines 149 and 150


Modify the line 172

// Change this line
$this->_productCollection = $this->getListBlock()->getLoadedProductCollection();

to the old code from Version

// Change the previous line to this one
$this->_productCollection = Mage::getSingleton(‘catalogsearch/layer’)->getProductCollection();

Once the code is fixed, go to the Admin panel (System > Index Management) and select all the Indexes > Pick action is “Reindex data” > Press “Submit”.

The search should work now.


2 Comments Comments For This Post I'd Love to Hear Yours!

  1. mark says:

    thank you very much, i had a new install magento and this worked PERFECTLY!!!

    Easy fix and very much needed..

  2. Matthew says:

    Thank you, did the trick. In our case 1.5.1 was not even “searching/filtering” the catalog of products for the search term and just returned everything visible.