When you install Magento 2.4, it's a requirement you set up ElasticSearch, since this is used for the search catalog in Magento 2.4.
You can either buy access to an ElasticSearch index via our site, or any hosted ElasticSearch.
You can either configure ElasticSearch 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:
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>
Click on Save, and you should now be ready to go!
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
Please sign in to leave a comment.