Magento 1.9 – Why Re-indexing is Often Required for Search to Work

catalogsearchindexingmagento-1.9search

Regularly on our site Magento's search feature stops working and when a user tries to search for a product nothing comes up in the search. Once we re-index Product Flat Data, Category Flat Data, Category Product and Catalog Search Index it begins working again.

Any idea why this happens, it happens very regularly, every week I guess. Is there anyway I can stop it from occurring or ways to debug why it is happening?

Update

To clarify, this is occurring when the user performs the search from either the Quick Search box or the Advanced search page.

The search seems to work by redirecting the user to catalog search page i.e. http://www.example.com/catalogsearch/result/?q=shirts

But the catalog page displays no results just the message. . .

Your search returns no results.

The rest of the page renders correctly, by which I mean the header, footer & left hand column etc.

There are no errors in the browser console or server logs.

Once we re-index Product Flat Data, Category Flat Data, Category Product and Catalog Search Index it begins working again.

Best Answer

The scenario you describe is quite common. You should perform a cron reindex on your Magento install.

You can do it addding to your crontab the following command:

php -q /yourmagentopaht/shell/indexer.php --reindexall

I strongly suggest to run it during the night.