Advanced search

  • Tier: Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
History

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.

Available scopes

Scopes describe the type of data you’re searching. The following scopes are available for advanced search:

ScopeGlobal 1GroupProject
Codecheck-circle-filled Yescheck-circle-filled Yescheck-circle-filled Yes
Commentscheck-circle-filled Yescheck-circle-filled Yescheck-circle-filled Yes
Commitscheck-circle-filled Yescheck-circle-filled Yescheck-circle-filled Yes
Epicscheck-circle-filled Yescheck-circle-filled Yesdash-circle No
Issuescheck-circle-filled Yescheck-circle-filled Yescheck-circle-filled Yes
Merge requestscheck-circle-filled Yescheck-circle-filled Yescheck-circle-filled Yes
Milestonescheck-circle-filled Yescheck-circle-filled Yescheck-circle-filled Yes
Projectscheck-circle-filled Yescheck-circle-filled Yesdash-circle No
Userscheck-circle-filled Yescheck-circle-filled Yescheck-circle-filled Yes
Wikischeck-circle-filled Yescheck-circle-filled Yescheck-circle-filled Yes

Footnotes:

  1. 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.

Syntax

History

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.

SyntaxDescriptionExample
"Exact search"gem sidekiq"
~Fuzzy searchJ~ Doe
|Ordisplay | banner
+Anddisplay +banner
-Excludedisplay -banner
*Partialbug error 50*
\Escape\*md
#Issue ID#23456
!Merge request ID!23456
SyntaxDescriptionExample
filename:Filenamefilename:*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

QueryDescription
rails -filename:gemfile.lockReturns rails in all files except the gemfile.lock file.
RSpec.describe Resolvers -*builderReturns RSpec.describe Resolvers that does not start with builder.
bug | (display +banner)Returns bug or both display and banner.
helper -extension:yml -extension:jsReturns helper in all files except files with a .yml or .js extension.
helper path:lib/gitReturns helper in all files with a lib/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.