I've recently upgraded my Magento to 2.4 which necessitates the use of Elasticsearch.
Using the search function always shows the message "Your search returned no results". However using "Advanded Search" returns results as normal.
I've tested the connection and there seems to be no issues. My settings are as follows:
Elasticsearch Server Hostname | localhost |
Elasticsearch Server Port | 9200 |
Elasticsearch Index Prefix | magento2 |
Enable Elasticsearch HTTP Auth | No |
Elasticsearch Server Timeout | 50 |
Deactivating modules and running a re-index also does not seem to have resolved the issue so I am unsure what could be causing this problem
Solved! Go to Solution.
We think we've fixed this now. Essentially we had to disable the "Search" and "filter" options for some of the product attributes (I think that SKU was the troublesome one) and run the following commands in SQL:
1:
UPDATE catalog_eav_attribute SET is_filterable_in_search = 0 WHERE attribute_id IN (SELECT attribute_id FROM eav_attribute WHERE entity_type_id = 4 AND backend_type = 'varchar')
2:
UPDATE catalog_eav_attribute AS cea INNER JOIN eav_attribute AS ea ON ea.attribute_id = cea.attribute_id SET cea.is_filterable = 0, cea.is_filterable_in_search = 0 WHERE (cea.is_filterable = 1 OR cea.is_filterable_in_search = 1) AND frontend_input NOT IN ('boolean', 'multiselect', 'select', 'price');
After doing this and reindexing, the search function seems to be working properly now.
We think we've fixed this now. Essentially we had to disable the "Search" and "filter" options for some of the product attributes (I think that SKU was the troublesome one) and run the following commands in SQL:
1:
UPDATE catalog_eav_attribute SET is_filterable_in_search = 0 WHERE attribute_id IN (SELECT attribute_id FROM eav_attribute WHERE entity_type_id = 4 AND backend_type = 'varchar')
2:
UPDATE catalog_eav_attribute AS cea INNER JOIN eav_attribute AS ea ON ea.attribute_id = cea.attribute_id SET cea.is_filterable = 0, cea.is_filterable_in_search = 0 WHERE (cea.is_filterable = 1 OR cea.is_filterable_in_search = 1) AND frontend_input NOT IN ('boolean', 'multiselect', 'select', 'price');
After doing this and reindexing, the search function seems to be working properly now.