2022-04-14 12:09:31 +00:00
---
2022-05-31 15:09:02 +00:00
stage: Data Stores
2022-04-14 12:09:31 +00:00
group: Global Search
2022-09-21 21:13:33 +00:00
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2022-04-14 12:09:31 +00:00
---
# Advanced Search syntax **(PREMIUM)**
With [Advanced Search ](../advanced_search.md ), you can perform a thorough
2022-05-05 03:08:53 +00:00
search of your entire GitLab instance.
2022-04-14 12:09:31 +00:00
The Advanced Search syntax supports fuzzy or exact search queries with prefixes,
2022-05-05 03:08:53 +00:00
boolean operators, and more. Advanced Search uses
2022-04-14 12:09:31 +00:00
[Elasticsearch's syntax ](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html#simple-query-string-syntax ).
WARNING:
2022-05-05 03:08:53 +00:00
Advanced Search searches default project branches only.
2022-04-14 12:09:31 +00:00
## General search
2022-05-20 12:08:50 +00:00
<!-- markdownlint - disable -->
2022-05-05 03:08:53 +00:00
| Use | Description | Example |
|-----|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| `"` | Exact search | [`"gem sidekiq"` ](https://gitlab.com/search?group_id=9970&project_id=278964&scope=blobs&search=%22gem+sidekiq%22 ) |
2022-05-14 00:08:57 +00:00
| < code > | </ code > | Or | [<code>display | banner</code> ](https://gitlab.com/search?group_id=9970&project_id=278964&scope=blobs&search=display+%7C+banner ) |
2022-05-05 03:08:53 +00:00
| `+` | And | [`display +banner` ](https://gitlab.com/search?group_id=9970&project_id=278964&repository_ref=&scope=blobs&search=display+%2Bbanner&snippets= ) |
| `-` | Exclude | [`display -banner` ](https://gitlab.com/search?group_id=9970&project_id=278964&scope=blobs&search=display+-banner ) |
| `*` | Partial | [`bug error 50*` ](https://gitlab.com/search?group_id=9970&project_id=278964&repository_ref=&scope=blobs&search=bug+error+50%2A&snippets= ) |
| `\` | Escape | [`\*md` ](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=%5C*md&group_id=9970&project_id=278964 ) |
## Code search
2022-04-14 12:09:31 +00:00
2022-05-05 03:08:53 +00:00
| Use | Description | Example |
|--------------|---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
2022-05-24 21:09:08 +00:00
| `filename:` | Filename | [`filename:*spec.rb` ](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=filename%3A*spec.rb&group_id=9970&project_id=278964 ) |
2022-05-12 09:08:08 +00:00
| `path:` | Repository location | [`path:spec/workers/` ](https://gitlab.com/search?group_id=9970&project_id=278964&repository_ref=&scope=blobs&search=path%3Aspec%2Fworkers&snippets= ) |
2022-05-05 03:08:53 +00:00
| `extension:` | File extension, without the `.` | [`extension:js` ](https://gitlab.com/search?group_id=9970&project_id=278964&repository_ref=&scope=blobs&search=extension%3Ajs&snippets= ) |
| `blob:` | Git object ID | [`blob:998707*` ](https://gitlab.com/search?snippets=false&scope=blobs&repository_ref=&search=blob%3A998707*&group_id=9970 ) |
2022-04-14 12:09:31 +00:00
2022-05-05 03:08:53 +00:00
`extension` and `blob` return exact matches only.
2022-04-14 12:09:31 +00:00
2022-05-05 03:08:53 +00:00
## Examples
2022-04-14 12:09:31 +00:00
2022-05-05 03:08:53 +00:00
| Example | Description |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|
| [`rails -filename:gemfile.lock` ](https://gitlab.com/search?group_id=9970&project_id=278964&repository_ref=&scope=blobs&search=rails+-filename%3Agemfile.lock&snippets= ) | Show _rails_ in all files except the _`gemfile.lock`_ file. |
| [`RSpec.describe Resolvers -*builder` ](https://gitlab.com/search?group_id=9970&project_id=278964&scope=blobs&search=RSpec.describe+Resolvers+-*builder ) | Show all _RSpec.describe Resolvers_ that don't start with _builder_ . |
2022-05-14 00:08:57 +00:00
| [<code>bug | (display +banner)</code> ](https://gitlab.com/search?snippets=&scope=issues&repository_ref=&search=bug+%7C+%28display+%2Bbanner%29&group_id=9970&project_id=278964 ) | Show _bug_ **or** _display_ **and** _banner_ . |
2022-10-04 18:08:15 +00:00
| [<code>helper -extension:yml -extension:js</code> ](https://gitlab.com/search?group_id=9970&project_id=278964&repository_ref=&scope=blobs&search=helper+-extension%3Ayml+-extension%3Ajs&snippets= ) | Show _helper_ in all files, except for files with _`.yml`_ **or** _`.js`_ extensions. |
2022-04-14 12:09:31 +00:00
2022-05-05 03:08:53 +00:00
<!-- markdownlint - enable -->