GitHub launches preview of improved code search

GitHub is making significant improvements to its code search experience and has released a technology preview for an early look.

The current search index covers more than five million of the most popular public repositories. Additionally, developers can also search the private repositories they have access to.

GitHub recommends trying five search functions to see how they might improve your workflow:

  • Try a simple search and see how the smart sorting and code-optimized index help you find exactly what you’re looking for.
  • Search for an exact string, with support for substring and special character matching, or use regular expressions (enclosed in / separators).
  • Reach your searches with org: or repo: qualifiers, with autocomplete suggestions in the search box.
  • Refine your results using filters like language:, path:, extension: and Boolean operators (OR, NOT). Look up definitions for a symbol with symbol:.
  • Get familiar with additional features like directory tree view, symbol information for active scope, jump to definition, select to find, and more!

A full list of supported syntax is available here. You can also press? on any page to see the available keyboard shortcuts.

The current search interface is separate from the main GitHub experience. Once the company has incorporated the feedback and believes it is ready for wider adoption, it will integrate with the main site.

There are currently some notable limitations. First of all, the function only supports searching for content in the default branch and not all content in the repository is indexed.

The current limitations of the indexed code are:

  • Generated and sold code is excluded (as determined by Enry)
  • Empty files and files larger than 350 KiB are excluded
  • Only files encoded in UTF-8 are included
  • Very large repositories may not be indexed

Search results are limited to 10 pages, which should be sufficient for most searches, but it is worth noting. The company intends to provide support to retrieve all search results through an API in the future.

GitHub doesn’t guarantee during preview how quickly the index will update after a new push, but says it can usually be searched in a few minutes.

Developers can sign up for the code search preview here.

(Image credit: GitHub)

Digital Transformation

Looking to renew your digital transformation strategy? Learn more about Digital Transformation Week taking place May 11-12, 2022, and discover key strategies to make your digital efforts a success.

Tags: code, code search, coding, developer, git, github, preview, programming, repository, repository, search, software development, tools

Leave a Comment