Fix: Magento Catalog Search Broken / Not Working

Written by Sid Vel

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.


34 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.

  3. Jo says:

    Thanks so much – it worked like a dream!

    It totally fixed the issue I was having whereby a search was not filtering any products, instead it was delivering everything. My search is now back to normal and working perfectly!

  4. Matt W says:

    Thanks a ton! This really saved me…

    • Matt W says:

      Had this working, but then 1 1/2 days to 2 days later, the search stopped working again. I am again getting no results returned, and I didn’t change a thing after making the edits you suggested. Has anyone else had this problem? Can you please help shed some light on this?

      Running Magento 1.5.1 on Apache server. All DB tables pertaining to catalogsearch are still in order, and tables are filled with data.

      • Sid Vel says:

        Did you try reindexing? System > Index Management. Magento should refresh indexes on a regular basis. It can fail some time. Reindexing will always make it work, but it can fail again. Can you give a link to your website?

  5. Sunil says:

    Thanks a ton… i just can tell you how much help this is for me. I was trying to solve this for 2 days..

    Thanks a lot again

  6. Rico says:

    Thank you very much for this fix. Saved my day :)

  7. DM says:

    Worked! On my install, I was getting ALL products returned with any search term. This worked to narrow down the results.

  8. ARandomDeveloper says:

    THIS FIX WORKS (Tried and tested on Magento Version!!

    I have searched for hours trying to find a simple fix without editing code, but many websites led me back to this single fix.




  9. magefast says:

    Thank you.


  10. taulant says:

    thank you so much! I spent two hours trying to figure this out until I ran into your blog post. This fixed my problem. Version

  11. Dr. Gasket says:

    I am using 1.6 and search box does not find all products or none.
    i did all changes of uncomment and etc. re-index and compile…but still no results.
    for example i have 50 products under the brand Hobart. when you search Hobart you get only 1 results.
    all my products are set to be found in catalog and search

    what might be the problem ?

    Thank you

    public function setListCollection()
    return $this;

    * Retrieve Search result list HTML output
    * @return string
    public function getProductListHtml()
    return $this->getChildHtml(‘search_result_list’);

    * Retrieve loaded category collection
    * @return Mage_CatalogSearch_Model_Resource_Fulltext_Collection
    protected function _getProductCollection()
    if (is_null($this->_productCollection)) {
    $this->_productCollection = Mage::getSingleton(‘catalogsearch/layer’)->getProductCollection();

  12. Paul Doherty says:

    Worked like a charm on 1.6!!! Thanks.

  13. Thank you very very much. I have a theme updated to 1.6.2 and it crashed this way. Yours tips works perfectly and save me a lot of time.

  14. But doesnt work after upgrade from 1.6.2 to 1.7.0 (stable). =/

  15. sorry, my mistake. also works for 1.7.0. :P

  16. Ivn says:

    Hi there,

    I am using Magento CE 1.6.1 . I had line 149 n 150 already commented in my file. But i changed line 172 with the line you had mentioned.

    I also refreshed the indices but it still shows me the same results for any search term.

    It shows me a certain set of products for any search term which is constant.

    Any Ideas why this is happening? Can you please help me out?

  17. Konstantin says:

    Got same problem with 1.4 -> 1.6.2
    My respect to author for this solution, it works. After some additional investigation I found how to fix this without Magento core files modification.
    at app/design/frontend/[path_to_your_theme]/layout/catalogsearch.xml

    at -> section.
    this adds filter by attributes configured as “Use In Search Results Layered Navigation” and fixes this issue as side effect.

  18. Konstantin says:

    <block type=”catalogsearch/layer” name=”catalogsearch.leftnav” after=”currency” template=”catalog/layer/view.phtml”/>
    at section
    catalogsearch_result_index > reference name=”left”

  19. SC says:

    So same issue with Regardless of what term is searched, same set of results show up. In fact if i put some random term like ‘timbaktu” same result. Will the above solution fix that?

  20. Nick says:

    I want to express my thanks for this information. I have spent countless hours trying to figure out the search problem. The fix works perfectly.

    I still have one other annoying search problem. Can anyone help with this?

    We sell posters of a band called “the wanted” . If you search for “the wanted” it brings up 1500 unrelated products. I guess it is showing anything with the word “the”.

    If you just search “wanted” it only shows the relevant results.

    This problem is common with may product searches. Does anyone know what I can do? Is there a way to force search just to look at titles?


  21. Prabhu says:

    excellent work.

  22. Ankur says:

    Very nice fix

  23. johan says:

    Thanks! Works perfectly for Enterprise

  24. Felix Buenemann says:

    The proper fix for this is to make sure the catalogsearch/layer block is included in your catalogsearch.xml layout file.

    If you do not want layered search navigation to show up, disable it for all attributes from the backend. To also remove categories, change the catalogsearch/layer block like this in your catalogsearch.xml:


  25. Nayan says:

    Thank you so much…!!!!
    Its works perfectly in Magento …………

  26. Kunjesh Sukhadia says:

    Hello Sid Vel,

    Thank you your help. You really save my lots of hours.

    Thank you,
    Kunjesh Sukhadia.

  27. Worked great for some front end search issues on 1.7. Thanks Sid!

  28. Nanyak says:

    Thanks a lot… I am running Magento and this fix works very well.

    Thanks again!

34 Comments Trackbacks For This Post

  1. Magento 1.5 quick search returns all the products or unexpected result – a discussion and collected solutions | LAMP stuffs you look for
  2. Magento 1.5 quick search returns all the products or unexpected result – a discussion and collected solutions | Experience Explored
  3. Magento 1.5 quick search returns all the products or unexpected result – a discussion and collected solutions | Experience Explored
  4. Magento search returning 0 results, despite products enabled and proper visibility | BlogoSfera
  5. Magento search returning 0 results, despite products enabled and proper visibility