Setting Up OpenSearch for Magento 2.4 (Firstserv Guide)

Magento 2.4 requires a search engine to power its product catalogue. While Elasticsearch was previously used, OpenSearch is now the preferred and actively supported solution.

OpenSearch is not typically suited to shared hosting environments, but Firstserv provides a secure, managed OpenSearch cluster on eligible hosting plans—allowing Magento 2.4 to run efficiently and reliably.


Requesting Your OpenSearch Instance

Step 1: Access OpenSearch in cPanel

  1. Log in to cPanel
  2. Scroll to the Advanced section
  3. Click OpenSearch

Step 2: Request an Instance

  • Select the option to request a new OpenSearch instance
  • A “please wait” message will appear while your account is checked

⏱️ This process typically takes around 1 minute


Step 3: Receive Your Credentials

Once complete, you’ll be provided with unique OpenSearch connection details, including:

  • Host
  • Port
  • Username
  • Password

✅ Keep these details safe—you’ll need them for Magento configuration.


Configuring OpenSearch in Magento

Step 4: Open Magento Settings

  1. Log in to your Magento Admin dashboard
  2. Navigate to:
    Stores → Configuration

Step 5: Access Catalog Search Settings

  1. Go to:
    Catalog → Catalog
  2. Expand the Catalog Search section

Step 6: Enter OpenSearch Details

Update the following fields:

  • Search Engine: OpenSearch
  • Server Hostname: (from cPanel)
  • Server Port: (from cPanel)
  • Enable HTTP Authentication: Yes
  • Username: (from cPanel)
  • Password: (from cPanel)

Step 7: Test and Save

  • Click Test Connection to verify access
  • If successful, click Save Configuration

✅ Your Magento store is now using OpenSearch.


Converting from Elasticsearch to OpenSearch

If your store was previously using Elasticsearch, follow these additional steps.


Step 1: Request OpenSearch Credentials

  • Follow the steps above to generate your OpenSearch details

Step 2: Update Magento Configuration

  1. Go to:
    Stores → Configuration → Catalog → Catalog Search
  2. Change:
    • Search Engine: from Elasticsearch to OpenSearch
  3. Enter your new OpenSearch credentials

Step 3: Clear Cache and Reindex

After switching search engines, you must update your Magento data.

Option A: Using Terminal (Recommended)

 
 
 
 
 
 
Shell
 
 
bin/magento cache:flush
bin/magento indexer:reindex
 
 

Option B: Using Magento Admin

Clear Cache:

  • Go to:
    System → Cache Management
  • Click Flush Magento Cache

Reindex Data:

  • Go to:
    System → Index Management
  • Select all indexes
  • Choose Invalidate Index → Click Submit

⏱️ Note: Reindexing via the admin panel may take longer, depending on cron schedules.


Common Issues

Connection Test Fails

  • Double-check your OpenSearch credentials
  • Ensure HTTP authentication is enabled
  • Confirm host and port values are correct

Search Not Updating

  • Re-run:
    • Cache flush
    • Reindex process

Benefits of OpenSearch

✅ Faster product search
✅ Improved filtering and navigation
✅ Better performance with large catalogues
✅ Fully supported for Magento 2.4


Summary

To set up or migrate to OpenSearch:

  1. Request your OpenSearch instance via cPanel
  2. Add credentials to Magento settings
  3. Test the connection
  4. Flush cache and reindex

If you need help configuring or migrating your Magento search engine, the Firstserv support team is always available to assist.

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Installing LiteMage caching for Magento v2

LiteSpeed & LiteMage for Magento (Firstserv Guide) All Firstserv shared and business...

Configuring Redis caching in Magento

Object Caching and Redis for Magento (Firstserv Guide) What is Object Caching? Object...

Configuring Elasticsearch with Magento 2.4

Setting Up Elasticsearch for Magento 2.4 (Firstserv Guide) Magento 2.4 requires...

Installing LiteMage caching for Magento v1

LiteSpeed & LiteMage for Magento 1 (Firstserv Guide) All Firstserv shared and business...