Jump to content

Prestashop 1.7.2.4 in not indexing any product (search bar)


Naturel Deluxe

Recommended Posts

Hi! 

 

Our prestashop (1.7.2.4) is not indexing any product anymore ... 

I don't know how to fix this issue.... 

We didn't modify any core files... It was working several months without a problem. 

But we did delete the entire catalog & did a re-upload, this time with more combinations, less simple products... 

 

Debug modus, doens't tell me anything, no errors where displayed. 

I think the problem is in the msql d-base, I checked the ps_search & there are thousands of product related to the table. 

But I don't know what's save to do... Can I just clear the tables related to search? 

 

Thanks in advance

Link to comment
Share on other sites

  • 10 months later...
On 10/17/2018 at 1:43 PM, dinesh badrukhiya said:

Hello,

You can try to re-build the entire index. Go to: Back-office > Configure > General > Search and click on re-build the entire index.

I have the same problem but with prestashop 1.7.5.2

I tried reindexing and nothing
I can't find a solution.
Can someone help me?

Link to comment
Share on other sites

  • 2 months later...
On 10/10/2018 at 11:00 PM, Naturel Deluxe said:

Hi! 

 

Our prestashop (1.7.2.4) is not indexing any product anymore ... 

I don't know how to fix this issue.... 

We didn't modify any core files... It was working several months without a problem. 

But we did delete the entire catalog & did a re-upload, this time with more combinations, less simple products... 

 

Debug modus, doens't tell me anything, no errors where displayed. 

I think the problem is in the msql d-base, I checked the ps_search & there are thousands of product related to the table. 

But I don't know what's save to do... Can I just clear the tables related to search? 

 

Thanks in advance

You cat allways try to delete the cache by going to BackOffice -> Performance -> clear cache and or deleting trough FTP the contents of /var/cache/prod...

You can also use the free tool that is on Modules Catalog "Prestashop Cleaner" (green icon).

You can also try a database repair trough your CPANEL.

Than try to reindex again.

Remember to allways BACKUP EVERYTHING...

Best Regards

Link to comment
Share on other sites

  • 5 months later...

Hello, I allow myself to leave the topic, following an error which can be the source of error for others.

In my case it was impossible to search from the search bar in the shop. (prestashop 1.7.4.2)

After adding DEBUG mode (thanks PCQUATRO), we got this error:

Fatal error: Uncaught Failed to read auto-increment value from storage engine INSERT IGNORE INTO wd_search_word (id_lang, id_shop, word) VALUES ....


We have therefore reached the identifier limit available in the table ....
We are using a cron which launches the url indicated by prestashop to reconstruct the index, has anyone had this problem?

For the solution we used this sql request:

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE `MYPREFIXTABLE_search_index`;
TRUNCATE `MYPREFIXTABLE_search_word`;
SET FOREIGN_KEY_CHECKS = 1;


Then we rebuilt the index on the site and the search bar works again.

I hope it will help others, but I do not understand why prestashop does not manage the identifiers, this problem will come back. Are we doing something wrong?

Edited by dcabrol
Add version of prestashop in the message and remove <br /> <br /> <pre> from error (see edit history)
Link to comment
Share on other sites

  • 2 months later...
On 4/8/2020 at 12:15 PM, dcabrol said:

 


SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE `MYPREFIXTABLE_search_index`;
TRUNCATE `MYPREFIXTABLE_search_word`;
SET FOREIGN_KEY_CHECKS = 1;


Then we rebuilt the index on the site and the search bar works again.

I hope it will help others, but I do not understand why prestashop does not manage the identifiers, this problem will come back. Are we doing something wrong?

Hi!

Thanks! It worked for me. My faceted search got an upgrade and after that my search bar stopped working. Running on prestashop 1.7.6.5

Link to comment
Share on other sites

  • 2 months later...

Hi!!!

I have a similar problem ona a PS 1.7.6.7 shop

search bar doesnt work... actualy it only shows manufacturer results, but it doesnt show any product results.

When activating debug mode it shows this error code when I perform any search:

 

 

[PrestaShopDatabaseException]

Key 'id_product' doesn't exist in table 'product_attribute_shop'<br /><br /><pre>SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, pl.`description_short`, pl.`available_now`, pl.`available_later`, pl.`link_rewrite`, pl.`name`, image_shop.`id_image` id_image, il.`legend`, m.`name` manufacturer_name ,( SELECT SUM(weight) FROM prstshp_search_word sw LEFT JOIN prstshp_search_index si ON sw.id_word = si.id_word WHERE sw.id_lang = 1 AND sw.id_shop = 1 AND si.id_product = p.id_product AND (sw.word LIKE '%moet%') ) position, DATEDIFF( p.`date_add`, DATE_SUB( "2020-08-27 00:00:00", INTERVAL 150 DAY ) ) > 0 new, product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity, IFNULL(product_attribute_shop.`id_product_attribute`,0) id_product_attribute FROM prstshp_product p INNER JOIN prstshp_product_shop product_shop ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 1) INNER JOIN `prstshp_product_lang` pl ON ( p.`id_product` = pl.`id_product` AND pl.`id_lang` = 1 AND pl.id_shop = 1 ) LEFT JOIN `prstshp_product_attribute_shop` product_attribute_shop FORCE INDEX (id_product) ON (p.`id_product` = product_attribute_shop.`id_product` AND product_attribute_shop.`default_on` = 1 AND product_attribute_shop.id_shop=1) LEFT JOIN prstshp_stock_available stock ON (stock.id_product = `p`.id_product AND stock.id_product_attribute = 0 AND stock.id_shop = 1 AND stock.id_shop_group = 0 ) LEFT JOIN `prstshp_manufacturer` m FORCE INDEX (PRIMARY) ON m.`id_manufacturer` = p.`id_manufacturer` LEFT JOIN `prstshp_image_shop` image_shop FORCE INDEX (id_product) ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop=1) LEFT JOIN `prstshp_image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = 1) WHERE p.`id_product` IN (3718,4214,5271,5313,5585,5586,5587) GROUP BY product_shop.id_product ORDER BY position desc LIMIT 0,24</pre>
at line 769 in file classes/db/Db.php

 

image.thumb.png.babfd324d1dd7020edbc0a62a9690ca5.png 

 

DbCore->displayError - [line 385 - classes/db/Db.php] - [1 Arguments]

DbCore->query - [line 613 - classes/db/Db.php] - [1 Arguments]

DbCore->executeS - [line 374 - classes/Search.php] - [3 Arguments]

SearchCore::find - [line 85 - src/Adapter/Search/SearchProductSearchProvider.php] - [9 Arguments]

PrestaShop\PrestaShop\Adapter\Search\SearchProductSearchProvider->runQuery - [line 308 - classes/controller/ProductListingFrontController.php] - [2 Arguments]

ProductListingFrontControllerCore->getProductSearchVariables - [line 580 - classes/controller/ProductListingFrontController.php]

ProductListingFrontControllerCore->doProductSearch - [line 82 - controllers/front/listing/SearchController.php] - [2 Arguments]

SearchControllerCore->initContent - [line 292 - classes/controller/Controller.php]

ControllerCore->run - [line 515 - classes/Dispatcher.php]

DispatcherCore->dispatch - [line 28 - index.php]

 

Can anybody help me?? 🙄

thanks in advace

Edited by Antakarana (see edit history)
Link to comment
Share on other sites

En 28/8/2020 a las 5:50 PM, lototo dijo:

Add index to database product_attribute_shop table


Key 'id_product' doesn't exist in table 'product_attribute_shop'

 

Thanks for your answer... Im not a professional of sql..... how can I make that query?

Thanks in advance!

 

PS. I have fixed it by adding the index that table.... a friend of mine who is a master on SQL fixed it :)

Edited by Antakarana (see edit history)
Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...
On 4/8/2020 at 11:15 AM, dcabrol said:

Hello, I allow myself to leave the topic, following an error which can be the source of error for others.

In my case it was impossible to search from the search bar in the shop. (prestashop 1.7.4.2)

After adding DEBUG mode (thanks PCQUATRO), we got this error:


Fatal error: Uncaught Failed to read auto-increment value from storage engine INSERT IGNORE INTO wd_search_word (id_lang, id_shop, word) VALUES ....

 

 

 


We have therefore reached the identifier limit available in the table ....
We are using a cron which launches the url indicated by prestashop to reconstruct the index, has anyone had this problem?

For the solution we used this sql request:


SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE `MYPREFIXTABLE_search_index`;
TRUNCATE `MYPREFIXTABLE_search_word`;
SET FOREIGN_KEY_CHECKS = 1;


Then we rebuilt the index on the site and the search bar works again.

I hope it will help others, but I do not understand why prestashop does not manage the identifiers, this problem will come back. Are we doing something wrong?

Saved my life Sir, Thank you!

Link to comment
Share on other sites

  • 4 months later...
  • 2 years 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...