0

After upgrade Magento from 2.3.5 to Magento 2.4.2, the categories page doesn't show any product. I have change Search Engine to Elasticsearch 7. When I check log, I found a bug:

[2021-03-19 08:32:17] main.CRITICAL: {"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [product_id] in order to sort on","index_uuid":"ZqaXmQlfQVqUEMFKpGUziw","index":"magecusabio_product_8_v1"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magecusabio_product_8_v1","node":"bhY-5xWvQ02x5cizTVMtKw","reason":{"type":"query_shard_exception","reason":"No mapping found for [product_id] in order to sort on","index_uuid":"ZqaXmQlfQVqUEMFKpGUziw","index":"magecusabio_product_8_v1"}}]},"status":400} {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"query_shard_exception\",\"reason\":\"No mapping found for [product_id] in order to sort on\",\"index_uuid\":\"ZqaXmQlfQVqUEMFKpGUziw\",\"index\":\"magecusabio_product_8_v1\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"magecusabio_product_8_v1\",\"node\":\"bhY-5xWvQ02x5cizTVMtKw\",\"reason\":{\"type\":\"query_shard_exception\",\"reason\":\"No mapping found for [product_id] in order to sort on\",\"index_uuid\":\"ZqaXmQlfQVqUEMFKpGUziw\",\"index\":\"magecusabio_product_8_v1\"}}]},\"status\":400} at /www/wwwroot/default/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:632)"} []
0

I have fixed it by run command lines:

php bin/magento module:enable --all

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy -f

php bin/magento cache:flush

php bin/magento indexer:reindex catalogsearch_fulltext

Hope it helps someone!

2
  • This error "No mapping found" keeps happening to us. When we add categories or remove categories from products this error happens to us. We can fix by running indexes and cache flush, however, that is only a temporary fix. Not a solution on how to fix the bug that keeps recurring. – Jonathan Jul 15 at 18:47
  • Hello @Jonathan, You can try setup cron job for your website. So, It will reindex auto. – David Duong Jul 20 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.