MySQL catalog search engine will be removed in Adobe Commerce 2.4.0. You must have Elasticsearch host setup and configured prior to installing version 2.4.0. Refer to Install and configure Elasticsearch.
This article provides a solution for changing the Adobe Commerce Search Engine using the Commerce Admin if the Search Engine field is not displayed or the Use system value checkbox is greyed out and not accessible.
In this article:
When you access the Catalog Search section, the Search Engine menu is not displayed at all.
The Store View for the Admin has been set to any value other than Default Config.
The search engine is a global configuration set on the application level, not on the Store Scope. Stores within an Adobe Commerce application cannot use different search engines.
Related documentation: Changing Scope in our user guide.
When you access the Catalog Search section of the Admin, the Use system value checkbox is greyed out so you cannot remove selection from the checkbox to later change the search engine.
The default search engine has been configured on the application configuration level in the
app/etc/config.php files and thus cannot be changed using the Admin.
Example of the section with default search engine configuration:
'system'=> array ( 'default'=> array ( 'catalog'=> array ( 'search'=> array ( 'engine'=>'mysql', ), ), ), ),
Remove the section with default search engine configuration from the
app/etc/env.php or the
app/etc/config.php configuration files.
Adobe Commerce configuration files in Adobe Commerce Configuration Guide
Switching search engines using the Admin is not available in Adobe Commerce on cloud infrastructure due to the way the cloud infrastructure has been organized.
During the deployment process, the Adobe Commerce on cloud infrastructure deployment scripts check if Elasticsearch has been declared in the
MAGENTO_CLOUD_RELATIONSHIPS variable. If declared, Elasticsearch is selected as the active search engine and configured automatically; the MySQL search engine becomes inaccessible in the Admin. If the Elasticsearch relationship has not been declared, MySQL is set to active, and Elasticsearch becomes inaccessible.
It is not recommended to edit the
app/etc/env.php or the
app/etc/config.php configuration files directly on your cloud environment; that is why changing these files to make the Elasticsearch engine to be displayed in the Admin (the solution we recommend in the previous section) is not applicable for your cloud project.
Before switching search engine from MySQL to Elasticsearch on your Staging and Production environments, make sure you have previously submitted a support ticket requesting to enable Elasticsearch on the environment and the ticket has been resolved successfully.
To change the search engine used on your Staging and Production environments, change the
SEARCH_CONFIGURATION environment variable in your
.magento.env.yaml file on your local environment, then push changes to the Integration and Staging/Production environments for the changes to take effect.
If you switch from MySQL to Elasticsearch, the SEARCH_CONFIGURATION variable in the resulting
.magento.env.yaml file might look as follows:
stage: deploy: SEARCH_CONFIGURATION: engine: elasticsearch elasticsearch_server_hostname: hostname elasticsearch_server_port: '123456' elasticsearch_index_prefix: magento elasticsearch_server_timeout: '15'