libreriasemola Posted May 16, 2020 Share Posted May 16, 2020 Hallo I have an issue with the search bar of my shop www.libreriasemola.it I used to run Prestashop 1.7.3 - and today updated to PS 1.7.6.5 in order to see if the problem could be solved, but it is not. the matter is simple: search bar displays no results. I tried to: - rebuild index form BO Search panel - Clear cache - Truncate ps_search_index table in database (and then restored from backup as nothing changed) I also installed an ajax search module (joli search) but it does not return any result. Any suggestion? thank you in advance! Corrado Link to comment Share on other sites More sharing options...
musicmaster Posted May 17, 2020 Share Posted May 17, 2020 Did you look for php errors in your log file? This is an ajax process so you may not see errors in development mode. Link to comment Share on other sites More sharing options...
libreriasemola Posted May 17, 2020 Author Share Posted May 17, 2020 Thank you @musicmaster , log shows no errors. I wonder if this may be a matter of database too big; should I truncate tables ps_search_index or / and ps_search_word maybe? Link to comment Share on other sites More sharing options...
musicmaster Posted May 17, 2020 Share Posted May 17, 2020 Those tables should be automatically emptied and refilled when you regenerate your search index. BTW, what doesn't work? The preview or the results when you actually click the maginifying glass? Link to comment Share on other sites More sharing options...
libreriasemola Posted May 17, 2020 Author Share Posted May 17, 2020 both preview and the results when you actually click the maginifying glass show no results. I think the issue is with indexation from back office. May I get some critical error if I truncate tables ps_search_index or / and ps_search_word in the database? thank you @musicmaster Link to comment Share on other sites More sharing options...
libreriasemola Posted May 17, 2020 Author Share Posted May 17, 2020 I solved the issue. I manually truncated tables ps_search_index or / and ps_search_word from sql , then reindexed from back office. now search works. thank you @musicmaster for your assistance. Link to comment Share on other sites More sharing options...
Anders N. Posted July 10, 2020 Share Posted July 10, 2020 Newbie here with the same issue. How do you manually truncate tables ps_search_index or / and ps_search_word from sql? What specifically did you do/write (in the code) to make the search work? I hope you can help me out Link to comment Share on other sites More sharing options...
musicmaster Posted July 10, 2020 Share Posted July 10, 2020 TRUNCATE TABLE ps_search_index TRUNCATE TABLE ps_search_word Link to comment Share on other sites More sharing options...
Anders N. Posted July 10, 2020 Share Posted July 10, 2020 9 minutes ago, musicmaster said: TRUNCATE TABLE ps_search_index TRUNCATE TABLE ps_search_word Thanks for the reply. I'm sorry to be so new but how does one find those 2 files? Could you provide an example of where and an example of the edit? Been stuck with this problem too long and I'm sure I'm loosing customers because of it... Link to comment Share on other sites More sharing options...
musicmaster Posted July 10, 2020 Share Posted July 10, 2020 Please make yourself known with the program Phpmyadmin. 1 Link to comment Share on other sites More sharing options...
Anders N. Posted July 10, 2020 Share Posted July 10, 2020 Thanks but when I press Truncate on the 2 files in Phpadmin I simply get the message "MySQL returnerede ingen data (fx ingen rækker)" or a rough translation to English: "MySQL didn't return any data (for example no rows)" Any idea what's wrong here? The products are visible in backoffice and show up in Front office just not in search bar after I upgraded from prestashop 1.6 to 1.7.6.5 Link to comment Share on other sites More sharing options...
Anders N. Posted July 10, 2020 Share Posted July 10, 2020 I made an entire thread on my search bar issue HERE if you need more info but no help there so far. I'm suprised it's so complicated to make the search bar work. My site is called www.retroreden.dk Link to comment Share on other sites More sharing options...
musicmaster Posted July 10, 2020 Share Posted July 10, 2020 "MySQL didn't return any data" is normal. What matters is that the tables have now a zero length. Did you clean the cache afterwards? Link to comment Share on other sites More sharing options...
Anders N. Posted July 10, 2020 Share Posted July 10, 2020 Yes I cleared both Prestashop and browser cache but still no results when using the Search bar Link to comment Share on other sites More sharing options...
Anders N. Posted July 10, 2020 Share Posted July 10, 2020 I just tried something. When debug mode is turned on I get this message but I don't know what to make of it and how to fix it. Do you understand it? Link to comment Share on other sites More sharing options...
musicmaster Posted July 10, 2020 Share Posted July 10, 2020 It looks like some database irregularity is the problem. You can do two things: you can use the PSCleaner module to get such irregularities removed. You can also target the specific product id of this error (3444) and remove all entries with it from all the ps_product* tables. 1 Link to comment Share on other sites More sharing options...
Anders N. Posted July 11, 2020 Share Posted July 11, 2020 21 hours ago, musicmaster said: It looks like some database irregularity is the problem. You can do two things: you can use the PSCleaner module to get such irregularities removed. You can also target the specific product id of this error (3444) and remove all entries with it from all the ps_product* tables. Thank you very much for trying to help. I installed the PSCleaner module just now and ran "functional integrity constraints" and "Database cleaning" but unfortunately the search bar in FO is still not working. Regarding removing all entries with the product id 3444 (the item I made a search for) from all the ps_product tables. It doesn't matter what product I search for I get the same message in debug mode just with a new product id for a different product of course. So that would mean deleting all entries from all my products? I got around 3000 😮 Link to comment Share on other sites More sharing options...
bnadauld Posted July 18, 2020 Share Posted July 18, 2020 (edited) On 5/18/2020 at 1:19 AM, musicmaster said: Those tables should be automatically emptied and refilled when you regenerate your search index. To regenerate the search index do you click 'Re-build the entire index'? What happens if you click this and the db table ps_search_index stays the same in myphp admin. Can you just truncate ps_search_index? Or will this cause the shop to break? My ps_search_index table is 15mb and its making backups via my hosting a problem. Hope you can help Edited July 18, 2020 by bnadauld (see edit history) Link to comment Share on other sites More sharing options...
musicmaster Posted July 18, 2020 Share Posted July 18, 2020 6 minutes ago, bnadauld said: 1. To regenerate the search index do you click 'Re-build the entire index'? 2. What happens if you click this and the db table ps_search_index stays the same in myphp admin. Can you just truncate ps_search_index? Or will this cause the shop to break? My ps_search_index table is 15mb and its making backups via my hosting a problem. 1. Yes 2. you should truncate both tables Link to comment Share on other sites More sharing options...
bnadauld Posted July 18, 2020 Share Posted July 18, 2020 (edited) Thanks i'll backup and then truncate ps_search_index ps_search_word Whats the point of these tables - just for stats on your dashboard. Im pretty nervous doing stuff to the db like this as past experience - moding the db has caused psdbexceptions like above. Edited July 18, 2020 by bnadauld (see edit history) Link to comment Share on other sites More sharing options...
musicmaster Posted July 18, 2020 Share Posted July 18, 2020 4 minutes ago, bnadauld said: Thanks i'll backup and then truncate ps_search_index ps_search_word What the point of these tables - just for stats on your dashboard. Im pretty nervous doing stuff to the db like this as past experience moding the db has caused psdbexceptions like above. At the right top of your webshop you have a search bar or other way to search your webshop. These tables provide the data. Link to comment Share on other sites More sharing options...
bnadauld Posted July 18, 2020 Share Posted July 18, 2020 (edited) 11 minutes ago, musicmaster said: At the right top of your webshop you have a search bar or other way to search your webshop. These tables provide the data. i only have 300 products why is there so many entries? maybe as everytime i rebuild the index the new rebuild was added to the end of the ps_search_index table? Edited July 18, 2020 by bnadauld (see edit history) Link to comment Share on other sites More sharing options...
musicmaster Posted July 18, 2020 Share Posted July 18, 2020 10 minutes ago, bnadauld said: i only have 300 products why is there so many entries? maybe as everytime i rebuild the index the new rebuild was added to the end of the ps_search_index table? I assume you have quite long descriptions. Every word there (with the exception of the most common words) gets its entry in those two tables. Link to comment Share on other sites More sharing options...
bnadauld Posted July 18, 2020 Share Posted July 18, 2020 1 minute ago, musicmaster said: I assume you have quite long descriptions. Every word there (with the exception of the most common words) gets its entry in those two tables. I DO! Thanks v much for your help Link to comment Share on other sites More sharing options...
GTTmtx Posted July 22, 2020 Share Posted July 22, 2020 Hi everybody, I'm also having some issues with the default search bar and I can't find a proper way to solve it, besides re-installing prestashop from scratch. I'm starting a online business and I'm running on Prestashop v 1.7.6.7, and I bought recently a new theme to boost the store. After installing the new theme, I started exploring and testing every module in search of possible malfunctions (including an ajax search module) to report do the developer. While doing so, in theme comparisons I switched back to the default theme from v 1.7.6.7 and for my surprise the default search bar stopped working. Anything that I try to insert doesn't have a match and it gives me a 404 error or a blank page. I've done some research and I tried a few things like resetting the module, re-building index, including what @musicmaster advised with Phpmyadmin, but still with no success. Re-installing prestashop from scratch is not a viable option, specially if it happens again and so on. Can anyone shine some light and help? Thanks in advance! Link to comment Share on other sites More sharing options...
musicmaster Posted July 22, 2020 Share Posted July 22, 2020 Check for javascript errors. Link to comment Share on other sites More sharing options...
GTTmtx Posted July 22, 2020 Share Posted July 22, 2020 8 hours ago, musicmaster said: Check for javascript errors. Well, it seems the trigger behind the problem with the Search Bar function was an extra file I located by FTP (SearchController.php) left by the theme I purchased. As soon I deleted the file, the problem was solved. I should have used the Debug Mode in a proper way. Thanks for the help. Link to comment Share on other sites More sharing options...
Anders N. Posted July 23, 2020 Share Posted July 23, 2020 18 hours ago, GTTmtx said: Well, it seems the trigger behind the problem with the Search Bar function was an extra file I located by FTP (SearchController.php) left by the theme I purchased. As soon I deleted the file, the problem was solved. I should have used the Debug Mode in a proper way. Thanks for the help. How did you find out that file was the issue? I just 1-click upgraded standard theme. I didn't use any special themes. So I still have not found a solution to make the Search Bar work. Not familiar with debug mode but when I tried searching all I get in prestashop back office is WARNING translation not found. Other than that I still get the error message posted earlier. Can those translation errors be the reason my search bar doesn't work? Anyone have a clue for me here? Link to comment Share on other sites More sharing options...
Ajit Singh Posted July 29, 2020 Share Posted July 29, 2020 Hey Anders, I posted on another thread where you asked this question. If it is a database consistency issue, it should be fixed in the database. If you are getting that error, the safest thing to do is to reset the database after backup. That will ensure right set of columns are created in the table. Our module https://addons.prestashop.com/en/search-filters/46978-1-search.html is helpful after the database issue is resolved. I hope that helps. Link to comment Share on other sites More sharing options...
Anders N. Posted August 5, 2020 Share Posted August 5, 2020 On 7/29/2020 at 9:39 PM, Ajit Singh said: Hey Anders, I posted on another thread where you asked this question. If it is a database consistency issue, it should be fixed in the database. If you are getting that error, the safest thing to do is to reset the database after backup. That will ensure right set of columns are created in the table. Our module https://addons.prestashop.com/en/search-filters/46978-1-search.html is helpful after the database issue is resolved. I hope that helps. Thank you for reaching out Ajit. I will consider that module. But how to reset the database? Link to comment Share on other sites More sharing options...
Ajit Singh Posted August 5, 2020 Share Posted August 5, 2020 Hey Anders, to reset the database, you will have to talk to your hosting provider. That is not a functionality of prestashop. Link to comment Share on other sites More sharing options...
Anders N. Posted August 5, 2020 Share Posted August 5, 2020 Just now, Ajit Singh said: Hey Anders, to reset the database, you will have to talk to your hosting provider. That is not a functionality of prestashop. I will try to contact them and share the results here. Thank you Ajit. Link to comment Share on other sites More sharing options...
Sgarbo Posted December 6, 2020 Share Posted December 6, 2020 Hello! I have the same bookshell problem with regards to searching. I've tried them all and I'm about to give up! I hope some of you can help me. I've already tried: • rebuild index; • I manually truncated ps_search_index / ps_search_word; • I checked file error_log; • I have activated debug mode; Nothing at all. No errors reported. Neither in debug nor from the error log. Nothing. The only oddity I noticed (if it can indicate something perhaps to the most experienced) is that when I go to manually truncate the ps_search_word table and then rebuild the index, rows are created inside it with id_word, id_lang etc. Well, some of these words have "3" in the id_lang field which doesn't exist! I only have two languages (English id_lang 1 and Italiano id_lang 2). Where does the 3 come from? I checked in the ps_lang table and there are only l correctly (Prestashop 1.7.7 - PHP7.3) Link to comment Share on other sites More sharing options...
Diwad Posted January 15, 2022 Share Posted January 15, 2022 On 12/6/2020 at 6:23 PM, Sgarbo said: Hello! I have the same bookshell problem with regards to searching. I've tried them all and I'm about to give up! I hope some of you can help me. I've already tried: • rebuild index; • I manually truncated ps_search_index / ps_search_word; • I checked file error_log; • I have activated debug mode; Nothing at all. No errors reported. Neither in debug nor from the error log. Nothing. The only oddity I noticed (if it can indicate something perhaps to the most experienced) is that when I go to manually truncate the ps_search_word table and then rebuild the index, rows are created inside it with id_word, id_lang etc. Well, some of these words have "3" in the id_lang field which doesn't exist! I only have two languages (English id_lang 1 and Italiano id_lang 2). Where does the 3 come from? I checked in the ps_lang table and there are only l correctly (Prestashop 1.7.7 - PHP7.3) Hi, did you solve the problem? Link to comment Share on other sites More sharing options...
pishkus Posted April 27, 2022 Share Posted April 27, 2022 Hi, maybe this would save some time to somebody. I've stumbled into similar empty search results problem today. My prestashop is fresh install 1.7.8.5. Although I've imported the products from prestashop 1.5 version, I doubt it was related to the search results. After some debuging, I've managed to get the search sql query and after putting it into phpmyadmin I got this error. #1176 - Key 'id_product' doesn't exist in table 'product_attribute_shop' So after adding index to the mentioned field, I was able to solve this problem. The query to add the index: ALTER TABLE `ps_product_attribute_shop` ADD INDEX(`id_product`) P.S. after writing this message I noticed that same exact error message was mentioned in this thread by Anders N. on July 10, 2020 (with added prestashop error message). 1 Link to comment Share on other sites More sharing options...
DoGGoD Posted May 3, 2022 Share Posted May 3, 2022 Hi, I had the same issue that after an update to 1.7.8.5 search bar stopped working again. To resolve I've truncated tables ps_search_index and ps_search_word then rebuilt the index from the backend search menu (Shop parameters - search) and it started working again. Link to comment Share on other sites More sharing options...
JulienPct Posted May 20, 2022 Share Posted May 20, 2022 Hello, I have made the same changes and this way I don't have the "No product found" message anymore. However, I don't have any product that appears Link to comment Share on other sites More sharing options...
Kogkalidis Posted August 8, 2022 Share Posted August 8, 2022 https://gist.github.com/tivuno/00d5ebcbfd3efc84ae3af0850ca60c51 Link to comment Share on other sites More sharing options...
Rasq Posted September 14, 2022 Share Posted September 14, 2022 On 5/17/2020 at 1:04 AM, libreriasemola said: Hallo I have an issue with the search bar of my shop www.libreriasemola.it I used to run Prestashop 1.7.3 - and today updated to PS 1.7.6.5 in order to see if the problem could be solved, but it is not. the matter is simple: search bar displays no results. I tried to: - rebuild index form BO Search panel - Clear cache - Truncate ps_search_index table in database (and then restored from backup as nothing changed) I also installed an ajax search module (joli search) but it does not return any result. Any suggestion? thank you in advance! Corrado Check in back-office Shop->Search in words there are not permited to see if your word for search is in there. If is in there you can't search for that word. Link to comment Share on other sites More sharing options...
QuickUpdate.net Posted September 14, 2022 Share Posted September 14, 2022 Try to reindex the products in the backoffice Link to comment Share on other sites More sharing options...
miketrf Posted November 18, 2022 Share Posted November 18, 2022 Had the same problem, but some products actually appeared in reseach, they where recently activated, so I just selected all products in BO and desactivated/activated them. No DB manipulation needed. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now