when I search any product in top search I get error in Magento.I searched lot in stack over flow and Magento stack exchange but all that solution is not worked in my case.

for ex : if I search "dell laptop" and hit enter it go to error page and error is below.

a:5:{i:0;s:494:" SQLSTATE[HY000]: General error: 2013 Lost connection to MySQL server during query, query was: INSERT INTO catalogsearch_result SELECT 2992 AS query_id, s.product_id, MATCH (s.data_index) AGAINST (:query IN BOOLEAN MODE) AS relevance FROM catalogsearch_fulltext AS sINNER JOIN catalog_product_entity AS e ON e.entity_id = s.product_id WHERE (s.store_id = 1) AND (MATCH (s.data_index) AGAINST (:query IN BOOLEAN MODE)) ON DUPLICATE KEY UPDATE relevance = VALUES(relevance) ";i:1;s:4001:"`

I also truncate all log tables but it's also not working in my case.

so if you guys have any other solution please share with me.

  • build index and try search for product..
    – Charlie
    May 24, 2016 at 5:10
  • @Charlie I tried that too any other solution.
    – Dhaval
    May 24, 2016 at 5:49
  • check local.xml file and make sure your database confugrations are correct. than clear var/cache floder and than try
    – Charlie
    May 24, 2016 at 6:32
  • @Charlie I have tried all ordinary solution that are available on net and I have tried above solution too. one more thing I am indexing using SSH so all indexing are reindex perfectly but "Catalog Search Index" is not reindexing.
    – Dhaval
    May 24, 2016 at 6:34

1 Answer 1


I have solved this issue at my end successfully :)

  1. First you delete locks folder under var directory: var/locks
  2. make sure 777 permission is var/locks and all files under locks directory.
  3. Take a backup of your database & delete catalog_product_flat_1, catalog_product_flat_2 or if there is another one.
  4. execute following code:

php indexer.php --reindex catalogsearch_fulltext This will reindex your Catalog Search Index or if you want to update all of the indexes run:

php indexer.php reindexall


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.