- Advanced Search syntax
- Search by issue or merge request ID
- Global search scopes
- Global Search validation
Moved to GitLab Premium in 13.9.
GitLab Advanced Search expands on the Basic Search with an additional set of features for faster, more advanced searches across the entire GitLab instance when searching in:
- Merge requests
- Wiki (except group wikis)
The Advanced Search can be useful in various scenarios:
- Faster searches: Advanced Search is based on Elasticsearch, which is a purpose-built full text search engine that can be horizontally scaled so that it can provide search results in 1-2 seconds in most cases.
- Code Maintenance: Finding all the code that needs to be updated at once across an entire instance can save time spent maintaining code. This is especially helpful for organizations with more than 10 active projects. This can also help build confidence is code refactoring to identify unknown impacts.
- Promote innersourcing: Your company may consist of many different developer teams each of which has their own group where the various projects are hosted. Some of your applications may be connected to each other, so your developers need to instantly search throughout the GitLab instance and find the code they search for.
See the documentation on Advanced Search syntax.
You can search a specific issue or merge request by its ID with a special prefix.
- To search by issue ID, use prefix
#followed by issue ID. For example, #23456
- To search by merge request ID, use prefix
!followed by merge request ID. For example !23456
Introduced in GitLab 14.3.
To improve the performance of your instance’s global search, you can limit
the scope of the search. To do so, you can exclude global search scopes by disabling
ops feature flags.
Global search has all its scopes enabled by default in GitLab SaaS and
self-managed instances. A GitLab administrator can disable the following
feature flags to limit the scope of your instance’s global search and optimize
|Code||When enabled, the global search includes code as part of the search.|
|Commits||When enabled, the global search includes commits as part of the search.|
|Issues||When enabled, the global search includes issues as part of the search.|
|Merge Requests||When enabled, the global search includes merge requests as part of the search.|
|Users||When enabled, the global search includes users as part of the search.|
|Wiki||When enabled, the global search includes wiki as part of the search. Group wikis are not included.|
prevent_abusive_searches. The feature is not ready for production use.
To prevent abusive searches, such as searches that may result in a Distributed Denial of Service (DDoS), Global Search ignores, logs, and
doesn’t return any results for searches considered abusive according to the following criteria, if
prevent_abusive_searches feature flag is enabled:
- Searches with less than 2 characters.
- Searches with any term greater than 100 characters. URL search terms have a maximum of 200 characters.
- Searches with a stop word as the only term (ie: “the”, “and”, “if”, etc.).
- Searches with a
project_idparameter that is not completely numeric.
- Searches with a
project_refparameter that has special characters not allowed by Git refname.
- Searches with a
scopethat is unknown.
Regardless of the status of the
prevent_abusive_searches feature flag, searches that don’t
comply with the criteria described below aren’t logged as abusive but are flagged with an error:
- Searches with more than 4096 characters.
- Searches with more than 64 terms.