Configuring Opensearch with Magento 2.4
Looking to convert from Elasticsearch to OpenSearch?
One of the most challenging features to support with Magento 2.4 is its dependency on OpenSearch, a system utilised for Magento's catalogue search engine. OpenSearch was not designed for a shared hosting environment; however, we now have a secure OpenSearch cluster available to our Business Hosting users, enabling Krystal to fully support Magento 2.4.
From within your cPanel, scroll down to the ADVANCED section and click on the OpenSearch option.
- Select highlighted option to request your OpenSearch instance.
- This will trigger a please wait notice, this allows the system to request a login from the OpenSearch cluster - this check can take around 1 minute.
- After the request has been completed you will receive a confirmation page that contains your new OpenSearch details. The details will be similar to the below but will contain a unique set of details generated for your cPanel account.
- With the login details you now need to insert them into Magento's store configuration. Make sure to login to your Magento admin area and from the dashboard select the Stores option and then Configuration.
- Next select the Catalog Category and then select the Catalog option under that menu.
- Expand the Catalog Search section and half way down are the OpenSearch options which will need to be updated. Make sure to enable HTTP Auth (set from no to yes) and then enter your details as provided in the cPanel plugin. Below is an example of the standard settings along with what your details may look like.
- Standard settings (how they look before being edited)
- Updated settings (how they look after inputting your correct information from cPanel
- Standard settings (how they look before being edited)
- Once entered you can test the connection to verify the cluster can be accessed and then save your changes.
Congratulations! You've now configured your Magento Store to use OpenSearch!
Converting from Elasticsearch to OpenSearch
To convert your Magento installation from using our previous Elasticsearch cluster to now use our OpenSearch cluster, you would firstly need to obtain the OpenSearch credentials in cPanel which can be done by following this article at the top from steps 1 to 4. Once you have your OpenSearch credentials, please follow steps 5 to 7 to get into the Catalog search settings. From there, you would need to change the "Search Engine" from Elasticsearch to "OpenSearch":

After updating the drop down to OpenSearch, please update the configuration settings as per step 7.
Once you've updated the configuration from Elasticsearch to OpenSearch, you will need to flush the Magento cache and reindex your Magento website. When in the command line for the site, you may run the following:
bin/magento cache:flush
bin/magento indexer:reindex
Alternatively, you may flush the cache and reindex your Magento site via the admin area using the GUI tools (though please note that this may take several minutes for the Magento cron to run and rebuild indexes):
Clear Cache through the admin area:
admin > system > cache management > Flush Magento Cache
Reindex the site through the admin area:
admin > system > index management - Select All and choose Invalidate Index from the Action drop down control, then click Submit.