Magento 2: no search results
-
05-03-2021 - |
题
When I enter a search query, Magento returns "no results". I am not using any search-related extensions. Already tried reindexing.
Where should I start debugging this?
I am running Magento 2.2.8
解决方案
Solved this problem, apparently there was a problem with the indexer, which failed on duplicated entries on catalog_product_index_eav_temp
:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3196-193-1-170-3196' for key 'PRIMARY', query was: INSERT INTO `catalog_product_index_eav_temp` (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`) VALUES (?, ?, ?, ?, ?), (?, ?, ?, ?, ?)
To fix it I had to manually update +- 100 records in the catalog_product_entity_varchar
table. For example: update value=170,170 to value=170
其他提示
Please check in admin product attributes set as searchable.
eg:
- Store >> Attributes >> Product
- Search for Name
- Check Storefront Properties >> Use in Search set as YES