SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH
search error magento2

Elastic search error can’t find products after upgrading to version Magento 2.4

You cannot search for the above product using Magento search after upgrading to version 2.4. First, check the necessary and sufficient conditions for your Magento site to run stably. Check it out right here in the Magento conditions sheet https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html

If the necessary and sufficient conditions on your server match the Magento version, but the search still cannot find the product. Please check your log file for errors recorded in magento_root/var/log if there is a line like in the image below open your phymyadmin and go to the database being used in the error Magento site

The investigation came to know this issue is due to the upgrade process. Some product attributes are text/varchar set to be filterable in search. like for me mentioned in the above error. So you need to search those in your DB and change their statuses. I use the following queries to fix those issues.

First, you can find those attributes to look at them

select * from catalog_eav_attribute WHERE is_filterable_in_search = 1 and attribute_id IN (SELECT attribute_id FROM eav_attribute WHERE entity_type_id = 4 AND backend_type = 'varchar')

Then you can run the following query:

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

In my case preorder_available_text this attribute is just appearing in error logs so I search this as well by the following query:

SELECT * FROM m2_data.eav_attribute where attribute_code = "preorder_available_text";

and get its id then run the following to mark it nonfilterable:

UPDATE catalog_eav_attribute SET is_filterable_in_search = 0 WHERE attribute_id IN (695)

The purpose of all this explanation is to give a brief on this issue and starting point to debugging for similar issues. If you find this blog useful, don’t hesitate to leave a comment and rate this article. Good luck.