← All insightsGetting Started

Getting started with Elasticsearch

CodeWizard Engineering · 16 August 2025 · 3 min read · Beginner

Elasticsearch is a distributed search and analytics engine built on Lucene, widely used for log analytics (the ELK/Elastic stack), full-text search and, increasingly, vector search.

Why teams use it

  • Powerful full-text search and aggregations
  • Mature log analytics with Kibana
  • Scales horizontally with sharding and replicas

Install it

bash
docker run -p 9200:9200 -e discovery.type=single-node \
  -e xpack.security.enabled=false docker.elastic.co/elasticsearch/elasticsearch:8.15.0

A first working config

Create an index with an explicit mapping.

bash
curl -X PUT localhost:9200/logs -H 'Content-Type: application/json' -d '{
  "mappings": { "properties": {
    "@timestamp": { "type": "date" },
    "level": { "type": "keyword" },
    "message": { "type": "text" }
  } }
}'

Run and verify

bash
curl -X POST localhost:9200/logs/_search -H 'Content-Type: application/json' -d '{
  "query": { "match": { "message": "timeout" } }
}'

Mistakes to avoid early

  • Unbounded mapping explosion from dynamic fields
  • Too many small shards hurting performance
  • No ILM, so indices grow without retention

Want senior help putting Elasticsearch to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult