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)"} []

1 Answer 1


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!

  • 1
    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
    Commented Jul 15, 2021 at 18:47
  • Hello @Jonathan, You can try setup cron job for your website. So, It will reindex auto. Commented Jul 20, 2021 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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