When I run the following command I get two entries in our config for Elastic Search 7 and 5

php bin/magento config:show | grep -Ei 'elastic|system/full_page_cache/caching_application|varnish|catalog/search/engine'

catalog/search/elasticsearch7_server_hostname - serverhostname
catalog/search/elasticsearch7_server_port - 42630
catalog/search/elasticsearch7_index_prefix - magento2
catalog/search/elasticsearch7_enable_auth - 0
catalog/search/elasticsearch7_server_timeout - 15
**catalog/search/elasticsearch5_server_hostname - differentserverhostname**

Why is elasticsearch5 appearing and how can I remove this line. Everything on the admin side is set to Elastic Search 7.0+

2 Answers 2


Just mentioning another case where this might happen.

I faced this issue due to live search being installed on my instance. As per DevDocs, Elasticsearch should be disabled if live search is installed, or if you are using elasticsearch and have live search installed, then disable it.

bin/magento module:disable Magento_LiveSearchAdapter Magento_LiveSearchStorefrontPopover

check the docs to live search


Config for elasticsearch5 is saved when you setup/upgrade Magento version or you saved config for Elastic Search on an older Magento version.

It is safe to delete these records, you can delete them from core_config_data: go to Mysql, and run the below command:

DELETE FROM `core_config_data` WHERE `path` LIKE '%catalog/search/elasticsearch5%';
  • Thanks. It must have come from an older version of Magento. I resolved the issue by upgrading to a newer version of Magento. After running the command again the record for elasticsearch5 was gone.
    – dave12
    Commented Oct 21, 2022 at 9:26
  • Glad to hear that. Cheers!
    – Tu Van
    Commented Oct 21, 2022 at 9:33

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.