---
title: "GitHub Issues search now supports nested queries and boolean operators: Here’s how we (re)built it"
description: "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."
url: "https://swe.quest/articles/github-issues-search-now-supports-nested-queries-and-boolean-operators-here-s-2684ca9cc7ff5489"
canonical: "https://github.blog/developer-skills/application-development/github-issues-search-now-supports-nested-queries-and-boolean-operators-heres-how-we-rebuilt-it/"
source: "GitHub Engineering"
published: "2025-05-13"
difficulty: "medium"
kind: "Case study"
reading_minutes: 9
tags: ["search","ruby","deployment","refactoring","testing"]
---

# GitHub Issues search now supports nested queries and boolean operators: Here’s how we (re)built it

A post on [GitHub Engineering](https://swe.quest/sources/github.md), published 2025-05-13, 9 min read, Case study. Original: [https://github.blog/developer-skills/application-development/github-issues-search-now-supports-nested-queries-and-boolean-operators-heres-how-we-rebuilt-it/](https://github.blog/developer-skills/application-development/github-issues-search-now-supports-nested-queries-and-boolean-operators-heres-how-we-rebuilt-it/)

## Summary

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. That tree is recursively traversed into nested Elasticsearch bool queries, with AND and OR mapped to must and should clauses. To protect backward compatibility at roughly 2,000 QPS, the team reran the existing test suites with the feature flag on and off and dark-shipped 1% of searches through both systems using the scientist library, comparing result counts and performance. The rollout capped nesting at five levels and started with the GraphQL API and the repository Issues tab before expanding to the dashboard and REST API.

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)
- [Ruby](https://swe.quest/tags/ruby.md) (Languages)
- [Deployment](https://swe.quest/tags/deployment.md) (Reliability & operations)
- [Refactoring & migrations](https://swe.quest/tags/refactoring.md) (Engineering practices)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)

## Prerequisites

- Elasticsearch bool queries ([easy posts on Search](https://swe.quest/tags/search.md?difficulty=easy))
- parsing and grammars

## Keywords

GitHub Issues, Elasticsearch, parslet, PEG, scientist, GraphQL

## Related posts

- [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.
- [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.
- [Using AI to detect similar issues](https://swe.quest/articles/using-ai-to-detect-similar-issues-df2d1445fbbe6dc8.md): Linear · 2023-11-29 · Medium · 5 min read · Vector search, PostgreSQL, Search, LLMs, Product engineering
  Linear detects duplicate and related issues by embedding issue text with an LLM and running cosine similarity search.
- [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.
- [Migrating From Elasticsearch 7.17 to Elasticsearch 8.x: Pitfalls and Learnings](https://swe.quest/articles/migrating-from-elasticsearch-7-17-to-elasticsearch-8-x-pitfalls-and-learnings-0f126d1759a782b4.md): Zalando Engineering · 2023-11-19 · Medium · 20 min read · Search, Refactoring & migrations, Java & JVM, Testing, Vector search
  Zalando's Search & Browse team moved their multi-cluster Elasticsearch deployment from 7.17 to 8.x, mainly to get approximate kNN vector search.

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)
