A distributed search and analytics engine for logs, full-text search and (now) vectors. This walkthrough covers the mental model and the configuration you will actually touch.
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.
The configuration that matters
Create an index with an explicit mapping.
curl -X PUT localhost:9200/logs -H 'Content-Type: application/json' -d '{
"mappings": { "properties": {
"@timestamp": { "type": "date" },
"level": { "type": "keyword" },
"message": { "type": "text" }
} }
}'Principles to hold onto
- Define explicit mappings; disable dynamic where possible
- Use Index Lifecycle Management for retention/rollover
- Size shards deliberately (tens of GB each)
Everyday commands
curl -X POST localhost:9200/logs/_search -H 'Content-Type: application/json' -d '{
"query": { "match": { "message": "timeout" } }
}'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.