Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Practice build · Data stores and distributed systems

Build your own Search Engine

Full-text search over a document collection: tokenising, an inverted index, TF-IDF and BM25 ranking, and phrase queries.

  • Intermediate
  • About 8–16 h
  • 4 checkpoints
  • 4 tutorials · Python, PHP

Pick a tutorial, then check yourself at each checkpoint. Work in any language you like.

Choose a tutorial

Why build it

Inverted indexes sit inside databases, log tools and RAG pipelines. Building one shows why lexical search still beats embeddings on exact terms, and how to measure result quality.

You will be able to

  • Tokenise and normalise text.
  • Build an inverted index with postings lists.
  • Rank results with TF-IDF, then BM25.
  • Measure result quality with precision@k on labelled queries.

Skills it exercises

Recommended on Applied AI Engineer and System Design.

Checkpoints

How you know you are there

Work in any language. Each checkpoint ends with something you can run or observe, so you can check it yourself.

  1. Checkpoint 1Self-check

    Index

    Done when: A collection of a few thousand documents is indexed into an inverted index that can be saved and loaded again.

  2. Checkpoint 2Self-check

    Boolean queries

    Done when: AND and OR queries return exactly the documents containing the terms, checked against a brute-force scan.

  3. Checkpoint 3Self-check

    Ranking

    Done when: Results are ranked with TF-IDF and with BM25, and precision@5 on 10 labelled queries is reported for both.

  4. Checkpoint 4Self-check

    Phrases and speed

    Done when: Phrase queries use positional postings, and a query over the full index answers in under 50 ms.

Stretch goals

  • Combine BM25 with vector search using reciprocal rank fusion.
  • A polite crawler that respects robots.txt.
Follow a tutorial

Step-by-step guides

Pick one in a language you know (tutorial languages: Python, PHP). They open on the author’s site.

Where to go next

Practice builds are self-paced: Tech Atlas does not track them or count them as evidence. To show a skill, take its knowledge check from the skill page.

Tutorials come from codecrafters-io/build-your-own-x (CC0, snapshot of 2026-07-14, commit aa17439; links checked on 2026-10-19). Each tutorial belongs to its author and keeps its own licence; Tech Atlas links to it and does not host it. Briefs, checkpoints and the mapping to skills are Tech Atlas editorial drafts.