REST Code Search API returns zero results for existing terms in some repositories #206246
Replies: 1 comment
|
Thank you for your interest in contributing to our community! We currently only accept discussions created through the GitHub UI using our provided discussion templates. Please re-submit your discussion by navigating to the appropriate category and using the template provided. This discussion has been closed because it was not submitted through the expected format. If you believe this was a mistake, please reach out to the maintainers. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Since approximately August 29, 2026, the REST Code Search API has been returning zero results for terms that definitely exist in some repositories.
Reproduction
Repository:
https://github.com/vistar941/CustomNavigationTitle
The term
CustomNavigationTitleexists inPackage.swift,README.md, and other files:https://github.com/vistar941/CustomNavigationTitle/blob/main/Package.swift
Request:
gh api --method GET search/code \ -f q='CustomNavigationTitle repo:vistar941/CustomNavigationTitle' \ -f per_page=3Actual response:
{ "total_count": 0, "incomplete_results": false, "items": [] }The request returned HTTP 200. It was not rate-limited:
Expected result: at least
Package.swiftandREADME.mdshould be returned.Control query
The API is not failing for every repository. The following request, made seconds later with the same authentication and client, returned seven results:
gh api --method GET search/code \ -f q='"package main" repo:cli/cli' \ -f per_page=3Response summary:
{ "total_count": 7, "incomplete_results": false }Its request ID was:
A single-character query such as
a repo:vistar941/CustomNavigationTitlealso returns results, while longer terms that definitely exist return zero results.I have observed the same behavior with multiple other public and private repositories. This was working normally until approximately yesterday.
The GitHub web Code Search interface appears to be affected as well. I added the web-search reproduction details to this related report:
https://github.com/orgs/community/discussions/206192#discussioncomment-18204982
Could GitHub please investigate whether some REST Code Search indexes or shards have become inconsistent?
All reactions