---
title: "The technology behind GitHub’s new code search"
description: "GitHub built Blackbird, a Rust code search engine, because general text search engines handled punctuation, regex, and GitHub's scale poorly, and brute-force grep would yield about 0.01 QPS."
url: "https://swe.quest/articles/the-technology-behind-github-s-new-code-search-7c9e939ab132b5db"
canonical: "https://github.blog/engineering/architecture-optimization/the-technology-behind-githubs-new-code-search/"
source: "GitHub Engineering"
published: "2023-02-06"
difficulty: "medium"
kind: "Case study"
reading_minutes: 13
tags: ["search","rust","system-design","scalability","data-structures"]
---

# The technology behind GitHub’s new code search

A post on [GitHub Engineering](https://swe.quest/sources/github.md), published 2023-02-06, 13 min read, Case study. Original: [https://github.blog/engineering/architecture-optimization/the-technology-behind-githubs-new-code-search/](https://github.blog/engineering/architecture-optimization/the-technology-behind-githubs-new-code-search/)

## Summary

GitHub built Blackbird, a Rust code search engine, because general text search engines handled punctuation, regex, and GitHub's scale poorly, and brute-force grep would yield about 0.01 QPS. It uses ngram inverted indices with lazily intersected posting-list iterators, shards by Git blob ID to deduplicate content, and delta-encodes repositories ordered by a similarity-based minimum spanning tree. Kafka decouples crawling from indexing and provides commit-level query consistency. Shards serve queries at about 100 ms p99 (roughly 640 QPS per 64-core host), and 115 TB of code fits in a 25 TB index that can be fully rebuilt in about 18 hours.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Search](https://swe.quest/tags/search.md) (Backend & APIs)
- [Rust](https://swe.quest/tags/rust.md) (Languages)
- [System design](https://swe.quest/tags/system-design.md) (Architecture & design)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)
- [Data structures](https://swe.quest/tags/data-structures.md) (Architecture & design)

## Prerequisites

- inverted indexes
- regular expressions
- Git object model
- sharding basics ([easy posts on Distributed databases](https://swe.quest/tags/distributed-databases.md?difficulty=easy))

## Keywords

Blackbird, GitHub code search, Kafka, ngram index, ripgrep, Elasticsearch, Redis

## Related posts

- [A brief history of code search at GitHub](https://swe.quest/articles/a-brief-history-of-code-search-at-github-ac152c8901d98c95.md): GitHub Engineering · 2021-12-15 · Medium · 13 min read · Search, Scaling, Developer tools
  GitHub's code search evolved from a public-only Solr index plus \`git grep\` for private repos, to a decade-long Elasticsearch deployment that grew to 162 nodes, 1.25PB of storage and over 53 billion indexed files.
- [How GitHub Docs’ new search works](https://swe.quest/articles/how-github-docs-new-search-works-0f03307c816bdb86.md): GitHub Engineering · 2023-03-09 · Medium · 10 min read · Search, JavaScript
  GitHub Docs replaced its in-memory Node.js site search, which loaded serialized indexes from the Git repo for eight languages and five versions, with Elasticsearch.
- [Fast regex search: indexing text for agent tools · Cursor](https://swe.quest/articles/fast-regex-search-indexing-text-for-agent-tools-cursor-45908cf7bb0688f8.md): Cursor · 2026-03-23 · Medium · 20 min read · Search, Data structures, Algorithms, AI agents, Developer tools
  Agents lean heavily on regex search, and ripgrep's full scan can take over 15 seconds in large monorepos, so Cursor builds local indexes specifically to accelerate regex queries.
- [Indexing code at scale with Glean](https://swe.quest/articles/indexing-code-at-scale-with-glean-139998a2186265ba.md): Meta Engineering · 2024-12-19 · Medium · 11 min read · Developer tools, Static analysis, Search, Code review, Open source
  Glean is Meta's open-source code indexing system that stores arbitrary language-specific facts about source code in RocksDB and exposes them through Angle, a declarative logic-based query language that can derive language-neutral views, much like SQL views.
- [How Hugging Face Inference Endpoints, Jobs, and Buckets Power Search on Papers with Code](https://swe.quest/articles/how-hugging-face-inference-endpoints-jobs-and-buckets-power-search-on-papers-ac5d7c4e21a2638e.md): Hugging Face · 2026-08-21 · Medium · 10 min read · Search, Vector search, PostgreSQL, Inference & serving, Data pipelines
  Papers with Code search combines PostgreSQL full-text search with pgvector semantic search over Qwen3-Embedding-0.6B vectors, fused by weighted reciprocal rank fusion (k=60), with exact-title, arXiv-ID and navigational matches pinned on top.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
