Make sure that you enable ElasticSearch during the setup of the docker containers. If you already setup your
environment, you can still enable it by rebuilding your containers using dev rebuild
and dev setup
.
ElasticSearch is available via elasticsearch:9200
and can be used in any application you want without any HTTP
authentication.
To make sure the ElasticSearch environment is running as expected, run this command in your terminal:
dev console curl -X GET "elasticsearch:9200/_cluster/health?pretty"
When you're working with Magento 2 and you use Smile ElasticSuite, you need to install two additional plugins for ElasticSearch that aren't installed by default. To do that make sure you follow the next steps:
Create a new file in ~/development/build/dist/elasticsearch/Dockerfile
Copy this content to the file:
FROM elasticsearch:6.5.4
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-phonetic && \
/usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-icu
Make sure that the version mentioned after FROM
is the same as the version of ElasticSearch that you installed.
Now make sure you rerun dev down
and dev rebuild
to install these plugins. You're now ready to use Smile
ElasticSuite.