Using OpenSearch

Available since magento-scripts 2.3.1

From Magento 2.4.8 CMA will use OpenSearch as the default search engine.

1. Create new CMA app

npx create-magento-app@latest magento-with-opensearch

2. Set searchengine to "opensearch" in the configuration section of the config file

cma.js
module.exports = {
    // ...other configurations
    configuration: {
        searchengine: 'opensearch' // <- set this
    }
};

2.1 Configure OpenSearch (optional)

module.exports = {
    // ...other configurations
    configuration: {
        searchengine: 'opensearch',
        opensearch: {
            // change opensearch image here
            image: 'opensearchproject/opensearch:2.13.0',
            env: {
                // additional environment variables for container
                OPENSEARCH_JAVA_OPTS: '-Xms512m -Xmx4096m'
            }
        }
    }
};

3. Run the application

You need to apply changes by running the start command without -s option.

Last updated