How do I setup Elasticsearch for my store?
To set it up Elasticsearch we will create a Docker container by running the following command in our terminal:
docker run -d \
-p 9200:9200 \
-m 1GB \
-e "discovery.type=single-node" \
-e "xpack.security.enabled=false" \
elasticsearch:8.17.4
-dEnables detached mode, meaning the container will run in the background without blocking the terminal.-p 9200:9200Maps port9200on your local machine (host) to port9200inside the container.-m 1GBLimits the container's memory usage to 1 GiB (else it will reserve 50% of your Docker memory).-e "discovery.type=single-node"Sets the environment variable to configure Elasticsearch to run insingle-nodemode.-e "xpack.security.enabled=false"Disables X-Pack security, meaning no authentication is required for accessing Elasticsearch.
You can check for the latest version to install instead of 8.17.4 here.
You can ensure Elasticsearch is running by visiting http://localhost:9200.