Jump to content

Search bar displays no results - Prestashop 1.7.6.5


Recommended Posts

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

 

 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Schermata 2020-05-17 alle 20.41.04.png

Share this post


Link to post
Share on other sites
  • 1 month later...

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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

  • Thanks 1

Share this post


Link to post
Share on other sites
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 😮 

Share this post


Link to post
Share on other sites
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 by bnadauld (see edit history)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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 by bnadauld (see edit history)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 by bnadauld (see edit history)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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!

firefox_psZMyfIfd8.png

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
  • 4 months later...

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)

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More