Question

I was curious what would happen if I stopped the Elasticsearch service in Magento 2.4. What I found I cant seem to understand.

When the service is stopped it empties all the categories. I would have assumed Elasticsearch was for the mini search/advanced search not the catalog listings.

Can anyone confirm if this is by design or is there a bug in Magento 2.4? Also any ideas on how to fix this?

My setup is Magento 2.4 on Valet (MacOs/PHP 7.3.20). I installed Elasticsearch via Homebrew.

Elasticsearch running With Elasticsearch running

Elasticsearch stopped With Elasticsearch stopped

Was it helpful?

Solution

ElasticSearch is in charge of the entire catalog and search, provisioning the data to Magento 2.4.

ElasticSearch is a requirement in Magento 2.4, as you can see in the page Magento 2.4 technology stack requirements, so it never can be disabled like in Magento 2.3.

I recommend to set the services to auto-restart in a production server, so if ElasticSearch or MySQL service goes down, it will restart automatically. You can do it in Docker using the parameter below.

docker run --restart=always
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top