Jump to content

Search bar displays no results - Prestashop 1.7.6.5


libreriasemola

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

 

 

Link to comment
Share on other sites

  • 1 month later...
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

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

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
Link to comment
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 😮 

Link to comment
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)
Link to comment
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

Link to comment
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)
Link to comment
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.

Link to comment
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)
Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
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?

 

Link to comment
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.

Link to comment
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?

Link to comment
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)

 

Link to comment
Share on other sites

  • 1 year later...
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

  • 3 months later...

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).

  • Like 1
Link to comment
Share on other sites

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

  • 3 weeks later...
  • 2 months later...
  • 1 month later...
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

  • 2 months later...

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...