There was a problem loading the comments.

Configure ElasticSearch / OpenSearch for Magento 2.4

Support Portal  »  General  »  Viewing Article

  Print

When you install Magento 2.4, it's a requirement you set up ElasticSearch / OpenSearch, since this is used for the search catalog in Magento 2.4.

You can either buy access to an ElasticSearch / OpenSearch index via our site, or any hosted ElasticSearch.

You can either configure ElasticSearch / OpenSearch from the GUI or from the command-line.

Via the GUI:

First navigate to Stores -> Settings -> Configuration -> Catalog -> Catalog -> Catalog Search.

By default, you'll see the following:

udYWGCm7MBWyIOUWZgRXesGkBmeFCBZKT7snX992Jl.png

What we're going to put here is:

Elasticsearch Server Hostname: https://elasticsearch-shared.h4r.eu (Keep in mind https:// is very important here!)

Elasticsearch Server Port: 443

Elasticsearch Index Prefix: <your_index>

Enable Elasticsearch HTTP Auth: Yes

Elasticsearch HTTP Username: <user_username>

Elasticsearch HTTP Password: <user_password>

sAeov9sUdCeTDECNfK9hUR1snWWutQR8NBCwgqvCvP.png

 

Click on Save, and you should now be ready to go!

Via CLI:

To do it via CLI, you'll have to go to the installation directory of Magento (Often public_html) and do the following:

$ php bin/magento config:set catalog/search/elasticsearch7_server_hostname 'https://elasticsearch-shared.h4r.eu'
$ php bin/magento config:set catalog/search/elasticsearch7_server_port 443
$ php bin/magento config:set catalog/search/elasticsearch7_enable_auth 1
$ php bin/magento config:set catalog/search/elasticsearch7_username username
$ php bin/magento config:set catalog/search/elasticsearch7_password password
$ php bin/magento config:set catalog/search/elasticsearch7_index_prefix index_name
$ php bin/magento setup:upgrade

Attachments


Share via
Did you find this article useful?  

Related Articles


Comments

Add Comment

Replying to  

CAPTCHA
© PerfGrid