Exact Code Search

Introduced in GitLab 15.9 with a flag named index_code_with_zoekt and search_code_with_zoekt which enables indexing and searching respectively. Both are disabled by default.

caution
Exact code search is in Alpha. For the Exact code search feature roadmap, see epic 9404.

This feature will initially only be rolled out to specific customers on GitLab.com that request access.

On self-managed GitLab it should be possible to enable this, but no documentation is provided as it requires executing commands from the Rails console as well advanced configuration of Zoekt servers.

Usage

When performing any Code search in GitLab it will choose to use “Exact Code Search” powered by Zoekt if the project is part of an enabled Group.

The main differences between Zoekt and Advanced Search are that Zoekt provides exact substring matching as well as allows you to search for regular expressions. Since it allows searching for regular expressions, certain special characters will require escaping. Backslash can escape special characters and wrapping in double quotes can be used for phrase searches.