doc/user/search/advanced_search.md
{{< details >}}
{{< /details >}}
Use advanced search to find exactly what you need across your entire GitLab instance.
With advanced search:
Advanced search works in:
Prerequisites:
To use advanced search:
You can also use advanced search in a project or group.
{{< history >}}
search_work_item_queries_notes. Disabled by default.search_work_item_queries_notes removed.search_merge_request_queries_notes. Disabled by default.search_merge_request_queries_notes removed.{{< /history >}}
Scopes describe the type of data you're searching. The following scopes are available for advanced search:
| Scope | Global <sup>1</sup> <sup>2</sup> | Group | Project |
|---|---|---|---|
| Code | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Comments | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Commits | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Work items <sup>3</sup> | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Merge requests <sup>3</sup> | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Milestones <sup>4</sup> | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Projects | {{< yes >}} | {{< yes >}} | {{< no >}} |
| Users | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Wikis | {{< yes >}} | {{< yes >}} | {{< yes >}} |
Footnotes:
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 |
| 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* |
| Query | Description |
|---|---|
rails -filename:gemfile.lock | Returns rails in all files except the gemfile.lock file. |
RSpec.describe Resolvers -*builder | Returns RSpec.describe Resolvers that does not start with builder. |
bug | (display +banner) | Returns bug or both display and banner. |
helper -extension:yml -extension:js | Returns helper in all files except files with a .yml or .js extension. |
helper path:lib/git | Returns helper in all files with a lib/git* path (for example, spec/lib/gitlab). |
You can search only files smaller than 1 MB. For GitLab Self-Managed, an administrator can set a limit on the maximum file size indexed.
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:
. , : ; / ` ' = ? $ & ^ | < > ( ) { } [ ] @
Search results show only the first match in a file.