Elasticsearch indexes billions of documents and returns results in milliseconds. Full-text search, aggregations, geo queries, and real-time analytics.
When You Need Elasticsearch
SQL LIKE '%search%' scans every row. At 1M documents, it takes seconds. At 100M documents, it's unusable.
Elasticsearch: inverted index. 100M documents, full-text search in <100ms.
What You Get for Free
Index a document:
curl -X POST 'localhost:9200/products/_doc' -H 'Content-Type: application/json' -d '{
"name": "Wireless Keyboard",
"description": "Bluetooth keyboard with backlit keys",
"price": 49.99,
"category": "electronics"
}'
Search with relevance:
curl 'localhost:9200/products/_search' -H 'Content-Type: application/json' -d '{
"query": {
"multi_match": {
"query": "wireless bluetooth keyboard",
"fields": ["name^3", "description"]
}
}
}'
Results ranked by relevance. Name matches weighted 3x. Typo tolerance, synonyms, stemming — all configurable.
Aggregations (analytics):
{
"aggs": {
"avg_price": { "avg": { "field": "price" } },
"categories": { "terms": { "field": "category" } },
"price_ranges": {
"range": {
"field": "price",
"ranges": [
{ "to": 25 },
{ "from": 25, "to": 100 },
{ "from": 100 }
]
}
}
}
}
Quick Start
docker run -d -p 9200:9200 -e "discovery.type=single-node" elasticsearch:8.12.0
Use Cases
- Product search — e-commerce sites with faceted navigation
- Log analytics — ELK stack (Elasticsearch + Logstash + Kibana)
- Application search — search across your app's content
- Geo search — find nearby restaurants, stores, events
- Security analytics — SIEM, threat detection, anomaly detection
- Metrics — time-series data with Kibana dashboards
The ELK Stack
Elasticsearch — stores and searches data
Logstash — ingests data from any source (logs, databases, APIs)
Kibana — visualizes data with dashboards, charts, maps
Free and open-source. The standard for observability.
If your app has a search bar and >10,000 records — Elasticsearch makes it instant.
Need web scraping or data extraction? Check out my tools on Apify — get structured data from any website in minutes.
Custom solution? Email spinov001@gmail.com — quote in 2 hours.
Top comments (0)