Magento Google Custom Search Engine

Magento Google Custom Search Engine

The easy way to disable CatalogSearch in Magento is to find the module Mage_CatalogSearch in app/etc/modules/Mage_All.xml and set active true into false. But you never change Magento core files. You override them. Changed core files will be overwritten on the next upgrade and you will lose your changes. In this blogpost I will explain you how to disable the module Mage_CatalogSearch in Magento the correct way.

The correct way to disable CatalogSearch in Magento functionality is to create a new XML file in app/etc/modules to override the core functionality. There are some restrictions though. 

  • The XML files in app/etc/modules are read in alphabetical order. 
  • First Mage_All.xml will be read then Mage* and then everything else in alphabetic order.
  • To ensure that your override will work you have to choose a name later in the alphabet then Mage_
  • For me the most logical file name for this override is Z_AllDisabledModules.xml

Disable CatalogSearch in Magento step by step

  • Go to app/etc/modules
  • Create a file named: Z_AllDisabledModules.xml
  • Copy & Paste the code below
  • Save & Close
  • After cleaning the cache and refresh of your Magento installation you will notice that your Magento site crashes. Bummer… big time bummer. According the created error report in var/report/ the module “Mage_XmlConnect” requires module “Mage_CatalogSearch”. This means that my override works well enough to disable the module Mage_CatalogSearch and also that there is another module depending on this one. I have to go back to the drawing-board.

    Prevent the rebuild Catalog product fulltext search index

    To get better search results with a higher conversion rate I replace Magento’s default search functionality by Google CSE. This is explained in the blogpost “How to embed Google Custom Search Engine in Magento“.

    With the replacement of Magento’s default search functionality by Google CSE I don’t need the module using this anymore. That’s where my logic goes wrong. I don’t have to disable the entire module Mage_CatalogSearch when I can prevent the module to rebuild catalog product fulltext search instead. When I can prevent the indexation I’m reducing server resources. And that’s what I want… reduction of server resources. 

    To prevent the rebuild Catalog product fulltext search index is simple and can be done within seconds with a couple of mouse clicks.

    • Login on Magento admin
    • Go to system >> Index Management
    • Check the option “Catalog Search Index”
    • Top right of the table select the action “Change index mode”
    • Select the index mode “Manual Update” and press submit
    • You’re done…

    From now on the Catalog product fulltext search index will not be rebuilt automatically on a save/edit/delete action in Magento. 

    p.s. I would like to thank Vinai Kopp and Mark van der Sanden for their contributions to the thought process.
    Scan je eigen Magento shop op veiligheidslekken