To configure OpenSearch as your Magento 2 search engine from the command line (CLI), run these three commands:
|
1 2 3 |
bin/magento config:set catalog/search/opensearch_server_hostname localhost bin/magento config:set catalog/search/opensearch_server_port 9200 --> Replace 9200 with your port bin/magento config:set catalog/search/engine opensearch |
The final command is optional and only necessary if OpenSearch was not already configured as the search engine.