Skip to main content

Search & Elasticsearch

Difficulty: Medium | Topic #19

What to Learn

Inverted index construction, full-text search (tokenization, stemming, relevance scoring with BM25/TF-IDF), index sharding and replication in Elasticsearch, near-real-time indexing, change data capture for sync.

Resources

Covered by Problems

ProblemDifficultyLink
Local Business Reviews (Yelp)Easy
News AggregatorMedium
Search Engine / FB Post SearchHard

Key Concepts to Master

  • Inverted index structure — term → doc list mapping
  • BM25 relevance scoring and how term frequency and field length factor in
  • Index sharding in Elasticsearch (primary + replica shards)
  • Near-real-time indexing (1-second refresh interval by default)
  • CDC (Debezium) to sync primary DB changes into Elasticsearch