Solved : – We can’t find products matching the selection Error after migration Magento2

If you are facing issue of “We can’t find products matching the selection” Error after migration.

To resolve these issues, you should look into the var/log/exception.log. In exception.log file, if it shows an issue with the configuration of a custom attribute.

The attribute was set to a type of textΒ for the attribute custom_attribute in the eav_attributeΒ table, butΒ is_filterableΒ set toΒ 1Β in theΒ catalog_eav_attributeΒ table. Setting this value to toΒ 0Β and reindexing/clearing cache allowed the category pages to load as expected.

Get misconfigured attributes:

sql command

select *
from catalog_eav_attribute cea
join eav_attribute ea
  on ea.attribute_id = cea.attribute_id
  and backend_type in ('text', 'varchar')
where
Β  cea.is_filterable = 1

and Set is_filterable to 0 to allow category pages to load.

update catalog_eav_attribute cea
join eav_attribute ea
  on ea.attribute_id = cea.attribute_id
  and backend_type in ('text', 'varchar')
set cea.is_filterable = 0
where
Β  cea.is_filterable = 1

Run below commands to Reindex/Refresh Cache

magento indexer:reindex
magento cache:clean
magento cache:flush