Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Product search in back-end works. Product Search in front-end results in SQLSTATE[23000]: Integrity constraint violation (Will make PayPal donation fo
 
bringyoutolife
Jr. Member
 
Total Posts:  2
Joined:  2010-04-07
 

Product search in the back-end of the store works fine. When using product search in the front-end of the store I am presented with the following error:

There has been an error processing your request

SQLSTATE[23000]
Integrity constraint violation1452 Cannot add or update a child rowa foreign key constraint fails (`reloaded_magento`.`catalogsearch_result`, CONSTRAINT `FK_CATALOGSEARCH_RESULT_QUERYFOREIGN KEY (`query_id`) REFERENCES `catalogsearch_query` (`query_id`) ON DELETE CASCADE ON UPDATE CASCADE)

Trace:
#0 /home/reloaded/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/reloaded/public_html/lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
#2 /home/reloaded/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#3 /home/reloaded/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#4 /home/reloaded/public_html/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext.php(317): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...', Array)
#5 /home/reloaded/public_html/app/code/core/Mage/CatalogSearch/Model/Fulltext.php(110): Mage_CatalogSearch_Model_Mysql4_Fulltext->prepareResult(Object(Mage_CatalogSearch_Model_Fulltext), 'c8180', Object(Mage_CatalogSearch_Model_Query))
#6 /home/reloaded/public_html/app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext/Collection.php(49): Mage_CatalogSearch_Model_Fulltext->prepareResult()
#7 /home/reloaded/public_html/app/code/core/Mage/CatalogSearch/Model/Layer.php(59): Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection->addSearchFilter('c8180')
#8 /home/reloaded/public_html/app/code/local/Pektsekye/Mmn/Model/Layer.php(64): Mage_CatalogSearch_Model_Layer->prepareProductCollection(Object(Sqli_SingleSearchResult_Model_Mysql4_Fulltext_Collection))
#9 /home/reloaded/public_html/app/code/community/Sqli/SingleSearchResult/controllers/CatalogSearch/ResultController.php(39): Pektsekye_Mmn_Model_Layer->getProductCollection()
#10 /home/reloaded/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Sqli_SingleSearchResult_CatalogSearch_ResultController->indexAction()
#11 /home/reloaded/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#12 /home/reloaded/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(177): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /home/reloaded/public_html/app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#14 /home/reloaded/public_html/app/Mage.php(596): Mage_Core_Model_App->run(Array)
#15 /home/reloaded/mystorenamehere.com/index.php(65): Mage::run('mystorenamehere', 'website')
#16 {main}

Error log record number2018764244

Magento is a trademark of Irubin Consulting Inc
DBA VarienCopyright Â© 2009 Irubin Consulting Inc.

I have already checked the mysql database and made sure the right tables are using InnoDB and the right tables are using MyISAM. I have also tried emptying out the catalogsearch tables and reindexing from backend and clearing caches but this error is still present and does not go away. I also tried switching to different templates. I have also read every single thread and post available on google regarding similar issues to this but have not seen anything that is exactly the same issue. Now I am finally posting here for help.

It is interesting to note that when typing a random word in the product search in the front end that does not match any products the search function works fine and shows the search page saying no search results found for this term. But when typing a product name in the product search then the error above comes up.

Any help or advice would be really appreciated and I will even make a donation to you via paypal for anyone that can solve this for me.

Thanks so much for your time in responding! smile
-Nick
AIM: bringyoutolife
MSN: bringyoutolife@gmail.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
Edwin van Olst
Jr. Member
 
Total Posts:  5
Joined:  2010-02-20
 

I’m having the exact same issue and I’ve also tried the exact same things. Still no luck.
I would really like to find a fix for this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1093
Joined:  2008-07-16
London, United Kingdom
 

Hi there,

Did you ever get to the bottom of this. ??
I see this everyday in our reports folder

brendan

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mirasvit
Guru
 
Avatar
Total Posts:  639
Joined:  2009-08-22
 

Hi there, check out these extensions Search AutoComplete & Suggest Pro. They greatly improve the quality and relevance of search results: http://mirasvit.com/magento-extensions/search-autocomplete-suggestions.html.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top