---
title: "How GitHub Docs’ new search works"
description: "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."
url: "https://swe.quest/articles/how-github-docs-new-search-works-0f03307c816bdb86"
canonical: "https://github.blog/engineering/architecture-optimization/how-github-docs-new-search-works/"
source: "GitHub Engineering"
published: "2023-03-09"
difficulty: "medium"
kind: "Case study"
reading_minutes: 10
tags: ["search","javascript"]
---

# How GitHub Docs’ new search works

A post on [GitHub Engineering](https://swe.quest/sources/github.md), published 2023-03-09, 10 min read, Case study. Original: [https://github.blog/engineering/architecture-optimization/how-github-docs-new-search-works/](https://github.blog/engineering/architecture-optimization/how-github-docs-new-search-works/)

## Summary

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. Each search is sent as one query built from a matrix of fields (title, headings, content), two analyzers (explicit with no stemming or synonyms, and Snowball-stemmed) and match types (phrase, AND, OR, fuzzy). Each combination gets a distinct multiplicative boost, so exact title phrase matches rank highest and terms like \`working-directory\` aren't swamped by stemmed matches. Final scores are multiplied by (1 + normalized pageview popularity), and query execution stays around 20 ms server-side.

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)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)

## Prerequisites

- Elasticsearch query DSL basics ([easy posts on Search](https://swe.quest/tags/search.md?difficulty=easy))
- text analyzers and stemming

## Keywords

Elasticsearch, GitHub Docs, Express.js, Snowball stemmer, Node.js

## Related posts

- [How MDN’s site-search works](https://swe.quest/articles/how-mdn-s-site-search-works-3d88867dabcc5021.md): Mozilla Hacks · 2021-03-22 · Medium · 6 min read · Search, System design, Python
  MDN's site search builds every page nightly in a GitHub Action, emitting index.json files.
- [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.
- [GitHub Issues search now supports nested queries and boolean operators: Here’s how we (re)built it](https://swe.quest/articles/github-issues-search-now-supports-nested-queries-and-boolean-operators-here-s-2684ca9cc7ff5489.md): GitHub Engineering · 2025-05-13 · Medium · 9 min read · Search, Ruby, Deployment, Refactoring & migrations, Testing
  GitHub rebuilt Issues search to support AND/OR operators and nested parentheses by replacing the flat-list parser with a PEG grammar (via the Ruby parslet library) that produces an abstract syntax tree.
- [How MDN’s autocomplete search works](https://swe.quest/articles/how-mdn-s-autocomplete-search-works-2a24a3a272638b76.md): Mozilla Hacks · 2021-08-03 · Medium · 5 min read · Search, Frontend, Web performance, JavaScript, React
  MDN Web Docs' autocomplete search runs entirely in the browser.
- [The technology behind GitHub’s new code search](https://swe.quest/articles/the-technology-behind-github-s-new-code-search-7c9e939ab132b5db.md): GitHub Engineering · 2023-02-06 · Medium · 13 min read · Search, Rust, System design, Scaling, Data structures
  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.

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)
