teacher
Sign in

Elasticsearch Internals

How an inverted index, shards and immutable segments make full-text search and log analytics fast, and why it should not be your primary database.

40 min4 interactive

What Elasticsearch is

Elasticsearch is a distributed search and analytics engine. It stores JSON documents and finds them by words, ranks them by relevance, and computes statistics over them. It is built on Apache Lucene, a Java library that does the actual indexing and searching inside each shard. Elasticsearch adds the distribution, a REST API and cluster management.

Two main jobs:

  • Search: product search, site search, autocomplete, filters.
  • Log and metrics analytics: the ELK stack (Elasticsearch, Logstash, Kibana).

A normal database index (see Indexing) answers "find the row with this key". Search needs "find documents containing these words, best first".

1 of 11