Advanced search
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
Version history
- Moved to GitLab Premium in 13.9.
Use advanced search to find exactly what you need across your entire GitLab instance.
With advanced search:
- Identify code patterns across all projects to refactor shared components more efficiently.
- Locate security vulnerabilities across your entire organization's codebase and dependencies using advanced vulnerability management.
- Track usage of deprecated functions or libraries throughout all repositories.
- Find discussions buried in issues, merge requests, or comments.
- Discover existing solutions instead of reinventing functionality that already exists.
Advanced search works in projects, issues, merge requests, milestones, users, epics, code, comments, commits, and wikis.
Use advanced search
Prerequisites:
- Advanced search must be enabled:
- For GitLab.com and GitLab Dedicated, advanced search is enabled by default in paid subscriptions.
- For GitLab Self-Managed, an administrator must enable advanced search.
 
To use advanced search:
- On the left sidebar, select Search or go to.
- In the search box, enter your search term.
You can also use advanced search in a project or group.
Available scopes
Scopes describe the type of data you're searching. The following scopes are available for advanced search:
| Scope | Global 1 2 | Group | Project | 
|---|---|---|---|
| Code | {check-circle-filled} Yes | {check-circle-filled} Yes | {check-circle-filled} Yes | 
| Comments | {check-circle-filled} Yes | {check-circle-filled} Yes | {check-circle-filled} Yes | 
| Commits | {check-circle-filled} Yes | {check-circle-filled} Yes | {check-circle-filled} Yes | 
| Epics | {check-circle-filled} Yes | {check-circle-filled} Yes | {dash-circle} No | 
| Issues | {check-circle-filled} Yes | {check-circle-filled} Yes | {check-circle-filled} Yes | 
| Merge requests | {check-circle-filled} Yes | {check-circle-filled} Yes | {check-circle-filled} Yes | 
| Milestones | {check-circle-filled} Yes | {check-circle-filled} Yes | {check-circle-filled} Yes | 
| Projects | {check-circle-filled} Yes | {check-circle-filled} Yes | {dash-circle} No | 
| Users | {check-circle-filled} Yes | {check-circle-filled} Yes | {check-circle-filled} Yes | 
| Wikis | {check-circle-filled} Yes | {check-circle-filled} Yes | {check-circle-filled} Yes | 
Footnotes:
- An administrator can disable global search scopes. On GitLab Self-Managed, global search is not available when limited indexing is enabled by default. An administrator can enable global search for limited indexing.
- On GitLab.com, global search is not enabled for code, commits, and wikis.
Syntax
Version history
- Refining user search introduced in GitLab 15.10.
Advanced search uses simple_query_string,
which supports both exact and fuzzy queries.
When you search for a user, the fuzzy query is used by default.
You can refine user search with simple_query_string.
| Syntax | Description | Example | 
|---|---|---|
| " | Exact search | "gem sidekiq" | 
| ~ | Fuzzy search | J~ Doe | 
| | | Or | display | banner | 
| + | And | display +banner | 
| - | Exclude | display -banner | 
| * | Partial | bug error 50* | 
| \ | Escape | \*md | 
| # | Issue ID | #23456 | 
| ! | Merge request ID | !23456 | 
Code search
| Syntax | Description | Example | 
|---|---|---|
| filename: | Filename | filename:*spec.rb | 
| path: | Repository location (full or partial matches) | path:spec/workers/ | 
| extension: | File extension without .(exact matches only) | extension:js | 
| blob: | Git object ID (exact matches only) | blob:998707* | 
Examples
| Query | Description | 
|---|---|
| rails -filename:gemfile.lock | Returns railsin all files except thegemfile.lockfile. | 
| RSpec.describe Resolvers -*builder | Returns RSpec.describe Resolversthat does not start withbuilder. | 
| bug | (display +banner) | Returns bugor bothdisplayandbanner. | 
| helper -extension:yml -extension:js | Returns helperin all files except files with a.ymlor.jsextension. | 
| helper path:lib/git | Returns helperin all files with alib/git*path (for example,spec/lib/gitlab). | 
Known issues
- 
You can search only files smaller than 1 MB. For more information, see issue 195764. For GitLab Self-Managed, an administrator can configure the Maximum file size indexed setting. 
- 
You can use advanced search only on the default branch of a project. For more information, see issue 229966. 
- 
The search query must not contain any of the following characters: . , : ; / ` ' = ? $ & ^ | < > ( ) { } [ ] @For more information, see issue 325234. 
- 
Search results show only the first match in a file. For more information, see issue 668.