diff options
Diffstat (limited to 'doc/user/search')
-rw-r--r-- | doc/user/search/advanced_search.md | 70 | ||||
-rw-r--r-- | doc/user/search/global_search/advanced_search_syntax.md | 49 | ||||
-rw-r--r-- | doc/user/search/img/advanced_search_v13.10.png | bin | 46767 -> 0 bytes | |||
-rw-r--r-- | doc/user/search/img/code_search_git_blame_v14_9.png | bin | 40505 -> 13872 bytes | |||
-rw-r--r-- | doc/user/search/img/sort_projects.png | bin | 59495 -> 0 bytes | |||
-rw-r--r-- | doc/user/search/index.md | 35 |
6 files changed, 75 insertions, 79 deletions
diff --git a/doc/user/search/advanced_search.md b/doc/user/search/advanced_search.md index cb272b3feed..5435a9d027c 100644 --- a/doc/user/search/advanced_search.md +++ b/doc/user/search/advanced_search.md @@ -26,8 +26,8 @@ when searching in: - Comments - Code - Commits -- Wiki (except [group wikis](../project/wiki/group.md)) - Users +- Wiki (except [group wikis](../project/wiki/group.md)) The Advanced Search can be useful in various scenarios: @@ -46,72 +46,9 @@ The Advanced Search can be useful in various scenarios: may be connected to each other, so your developers need to instantly search throughout the GitLab instance and find the code they search for. -## Use the Advanced Search syntax - -Elasticsearch has data for the default branch only. That means that if you go -to the repository tree and switch the branch from the default to something else, -then the **Code** tab in the search result page is served by the basic -search even if Elasticsearch is enabled. - -The Advanced Search syntax supports fuzzy or exact search queries with prefixes, -boolean operators, and much more. Use the search as before and GitLab shows -you matching code from each project you have access to. - -![Advanced Search](img/advanced_search_v13.10.png) - -Full details can be found in the [Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/query-dsl-simple-query-string-query.html#_simple_query_string_syntax), but -here's a quick guide: - -- Searches look for all the words in a query, in any order - for example: searching - issues for [`display bug`](https://gitlab.com/search?snippets=&scope=issues&repository_ref=&search=display+bug&group_id=9970&project_id=278964) and [`bug display`](https://gitlab.com/search?snippets=&scope=issues&repository_ref=&search=bug+Display&group_id=9970&project_id=278964) return the same results. -- To find the exact phrase (stemming still applies), use double quotes: [`"display bug"`](https://gitlab.com/search?snippets=&scope=issues&repository_ref=&search=%22display+bug%22&group_id=9970&project_id=278964) -- To find bugs not mentioning display, use `-`: [`bug -display`](https://gitlab.com/search?snippets=&scope=issues&repository_ref=&search=bug+-display&group_id=9970&project_id=278964) -- To find a bug in display or banner, use `|`: [`bug display | banner`](https://gitlab.com/search?snippets=&scope=issues&repository_ref=&search=bug+display+%7C+banner&group_id=9970&project_id=278964) -- To group terms together, use parentheses: [`bug | (display +banner)`](https://gitlab.com/search?snippets=&scope=issues&repository_ref=&search=bug+%7C+%28display+%2Bbanner%29&group_id=9970&project_id=278964) -- To match a partial word, use `*`. In this example, I want to find bugs with any 500 errors. : [`bug error 50*`](https://gitlab.com/search?snippets=&scope=issues&repository_ref=&search=bug+error+50*&group_id=9970&project_id=278964) -- To use one of symbols above literally, escape the symbol with a preceding `\`: [`argument \-last`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=argument+%5C-last&group_id=9970&project_id=278964) - -## Syntax search filters - -Advanced Search also supports the use of filters. The available filters are: - -- `filename`: Filters by filename. You can use the glob (`*`) operator for fuzzy matching. -- `path`: Filters by path. You can use the glob (`*`) operator for fuzzy matching. -- `extension`: Filters by extension in the filename. Please write the extension without a leading dot. Exact match only. -- `blob`: Filters by Git `object ID`. Exact match only. - -To use them, add them to your keyword in the format `<filter_name>:<value>` without -any spaces between the colon (`:`) and the value. When no keyword is provided, an asterisk (`*`) is used as the keyword. - -Examples: - -- Finding a file with any content named `search_results.rb`: [`* filename:search_results.rb`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=*+filename%3Asearch_results.rb&group_id=9970&project_id=278964) -- The leading asterisk (`*`) can be ignored in the case above: [`filename:search_results.rb`](https://gitlab.com/search?group_id=9970&project_id=278964&scope=blobs&search=filename%3Asearch_results.rb) -- Finding a file named `found_blob_spec.rb` with the text `CHANGELOG` inside of it: [`CHANGELOG filename:found_blob_spec.rb`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=CHANGELOG+filename%3Afound_blob_spec.rb&group_id=9970&project_id=278964) -- Finding the text `EpicLinks` inside files with the `.rb` extension: [`EpicLinks extension:rb`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=EpicLinks+extension%3Arb&group_id=9970&project_id=278964) -- Finding any file with the `.yaml` extension: [`extension:yaml`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=extension%3Ayaml&group_id=9970&project_id=278964) -- Finding the text `Sidekiq` in a file, when that file is in a path that includes `elastic`: [`Sidekiq path:elastic`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=Sidekiq+path%3Aelastic&group_id=9970&project_id=278964) -- Finding any file in a path that includes `elasticsearch`: [`path:elasticsearch`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=path%3Aelasticsearch&group_id=9970&project_id=278964) -- Finding the files represented by the Git object ID `998707b421c89bd9a3063333f9f728ef3e43d101`: [`* blob:998707b421c89bd9a3063333f9f728ef3e43d101`](https://gitlab.com/search?snippets=false&scope=blobs&repository_ref=&search=*+blob%3A998707b421c89bd9a3063333f9f728ef3e43d101&group_id=9970) -- Syntax filters can be combined for complex filtering. Finding any file starting with `search` containing `eventHub` and with the `.js` extension: [`eventHub filename:search* extension:js`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=eventHub+filename%3Asearch*+extension%3Ajs&group_id=9970&project_id=278964) - -### Excluding filters - -> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/31684) in GitLab 13.3. - -Filters can be inverted to **filter out** results from the result set, by prefixing the filter name with a `-` (hyphen) character, such as: - -- `-filename` -- `-path` -- `-extension` -- `-blob` - -Examples: +## Advanced Search syntax -- Finding `rails` in all files but `Gemfile.lock`: [`rails -filename:Gemfile.lock`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=rails+-filename%3AGemfile.lock&group_id=9970&project_id=278964) -- Finding `success` in all files excluding `.po|pot` files: [`success -filename:*.po*`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=success+-filename%3A*.po*&group_id=9970&project_id=278964) -- Finding `import` excluding minified JavaScript (`.min.js`) files: [`import -extension:min.js`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=import+-extension%3Amin.js&group_id=9970&project_id=278964) -- Finding `docs` for all files outside the `docs/` folder: [`docs -path:docs/`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=docs+-path%3Adocs%2F&group_id=9970&project_id=278964) +See the documentation on [Advanced Search syntax](global_search/advanced_search_syntax.md). ## Search by issue or merge request ID @@ -139,6 +76,7 @@ its performance: | Commits | `global_search_commits_tab` | When enabled, the global search includes commits as part of the search. | | Issues | `global_search_issues_tab` | When enabled, the global search includes issues as part of the search. | | Merge Requests | `global_search_merge_requests_tab` | When enabled, the global search includes merge requests as part of the search. | +| Users | `global_search_users_tab` | When enabled, the global search includes users as part of the search. | | Wiki | `global_search_wiki_tab` | When enabled, the global search includes wiki as part of the search. [Group wikis](../project/wiki/group.md) are not included. | ## Global Search validation diff --git a/doc/user/search/global_search/advanced_search_syntax.md b/doc/user/search/global_search/advanced_search_syntax.md new file mode 100644 index 00000000000..962aa00eea8 --- /dev/null +++ b/doc/user/search/global_search/advanced_search_syntax.md @@ -0,0 +1,49 @@ +--- +stage: Enablement +group: Global Search +info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments" +type: reference +--- + +# Advanced Search syntax **(PREMIUM)** + +With [Advanced Search](../advanced_search.md), you can perform a thorough +search through your entire GitLab instance. + +The Advanced Search syntax supports fuzzy or exact search queries with prefixes, +boolean operators, and much more. Advanced Search uses +[Elasticsearch's syntax](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html#simple-query-string-syntax). + +WARNING: +Advanced Search searches projects' default branches only. + +See query examples on the tables below and their respective expected output. +The examples link to a search on GitLab.com to help you visualize the output. + +## General search + +| Query example | Expected output | +|---|---| +[`“display bug”`](https://gitlab.com/search?snippets=&scope=issues&repository_ref=&search=%22display+bug%22&group_id=9970&project_id=278964) | Returns the **exact phrase** _display bug_ (stemming still applies). | +[`bug -display`](https://gitlab.com/search?snippets=&scope=issues&repository_ref=&search=bug+-display&group_id=9970&project_id=278964) | Results include _bug_, and **exclude** _display_. | +[<code>bug | display</code>](https://gitlab.com/search?snippets=&scope=issues&repository_ref=&search=bug+%7C+banner&group_id=9970&project_id=278964) | Results include _bug_ **or** _display_. | +[<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) | Results include _bug_ **or** _display_ **and** _banner_. | +| [`bug error 50*`](https://gitlab.com/search?snippets=&scope=issues&repository_ref=&search=bug+error+50*&group_id=9970&project_id=278964) | `*` finds **partial matches**. Results include _bug_, _error_, and the partial _50_ (looking for any 500 errors, for example). | +| [`bug \-display`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=argument+%5C-last&group_id=9970&project_id=278964) | `\` **scapes symbols**. Results include _bug_ **and** _-display_. | + +## Code Search + +| Query example | Expected output | Notes | +|---|---|---| +| [`filename:*spec.rb`](https://gitlab.com/search?snippets=&scope=blobs&repository_ref=&search=filename%3A*spec.rb&group_id=9970&project_id=278964) | Returns the specified filename. | Use `*` for fuzzy matching. | +| [`path:spec/controllers/`](https://gitlab.com/search?group_id=9970&project_id=278964&repository_ref=&scope=blobs&search=path%3Aspec%2Fcontrollers%2F&snippets=) | Returns the specified path location of the repository. | Use `*` for fuzzy matching. | +| [`extension:js`](https://gitlab.com/search?group_id=9970&project_id=278964&repository_ref=&scope=blobs&search=extension%3Ajs&snippets=) | Returns the specified file extension. | **Do not** include a leading dot. This only works with exact matches for the extension. | +| [`blob:998707b421c89b*`](https://gitlab.com/search?snippets=false&scope=blobs&repository_ref=&search=blob%3A998707b421c89b*&group_id=9970) | Returns the specified Git object ID. | This only works with exact matches. | + +## Excluding filters + +Filters can also be inverted to filter out results from the result set by prefixing the filter name with a `-` (hyphen) character. + +| Query example | Expected output | +|---|---| +| [`rails -filename:gemfile.lock`](https://gitlab.com/search?group_id=9970&project_id=278964&repository_ref=&scope=blobs&search=rails+-filename%3Agemfile.lock&snippets=) | Results include _`rails`_ in all files except the _`gemfile.lock`_ file. | diff --git a/doc/user/search/img/advanced_search_v13.10.png b/doc/user/search/img/advanced_search_v13.10.png Binary files differdeleted file mode 100644 index 39cd54fea75..00000000000 --- a/doc/user/search/img/advanced_search_v13.10.png +++ /dev/null diff --git a/doc/user/search/img/code_search_git_blame_v14_9.png b/doc/user/search/img/code_search_git_blame_v14_9.png Binary files differindex 33d4e77e3f5..eb8d14de4a4 100644 --- a/doc/user/search/img/code_search_git_blame_v14_9.png +++ b/doc/user/search/img/code_search_git_blame_v14_9.png diff --git a/doc/user/search/img/sort_projects.png b/doc/user/search/img/sort_projects.png Binary files differdeleted file mode 100644 index 9bf2770b299..00000000000 --- a/doc/user/search/img/sort_projects.png +++ /dev/null diff --git a/doc/user/search/index.md b/doc/user/search/index.md index 44327af380e..de5f469498e 100644 --- a/doc/user/search/index.md +++ b/doc/user/search/index.md @@ -14,8 +14,12 @@ The numbers indicate how many issues, merge requests, and to-do items are assign ![issues and MRs dashboard links](img/dashboard_links_v14_6.png) -- **{issues}** **Issues**: The open issues assigned to you. -- **{merge-request-open}** **Merge requests**: The [merge requests](../project/merge_requests/index.md) assigned to you. +- **{issues}** **Issues**: Issues assigned to you. +- **{merge-request-open}** **Merge requests**: Open [merge requests](../project/merge_requests/index.md). + Select the icon to show a dropdown list of merge request filters: + - [Attention requests](../project/merge_requests/index.md#request-attention-to-a-merge-request) (**{attention-solid}**) for you. + - [Review requests](../project/merge_requests/reviews/index.md) for you. + - Merge requests assigned to you. - **{todo-done}** **To-do items**: The [to-do items](../todos.md) assigned to you. You can search through **Open**, **Closed**, or **All** issues. @@ -37,6 +41,8 @@ in the search field in the upper right corner: > - Filtering by iterations was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/118742) in GitLab 13.6. > - Filtering by iterations was moved from GitLab Ultimate to GitLab Premium in 13.9. > - Filtering by type was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/322755) in GitLab 13.10 [with a flag](../../administration/feature_flags.md) named `vue_issues_list`. Disabled by default. +> - Filtering by type was [enabled on self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/322755) in GitLab 14.10. +> - Filtering by attention request was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/343528) in GitLab 14.10 [with a flag](../../administration/feature_flags.md) named `mr_attention_requests`. Disabled by default. Follow these steps to filter the **Issues** and **Merge requests** list pages in projects and groups: @@ -44,6 +50,7 @@ groups: 1. Select **Search or filter results...**. 1. In the dropdown list that appears, select the attribute you wish to filter by: - Assignee + - [Attention requests](../project/merge_requests/index.md#request-attention-to-a-merge-request) - Author - Confidential - [Epic and child Epic](../group/epics/index.md) (available only for the group the Epic was created, not for [higher group levels](https://gitlab.com/gitlab-org/gitlab/-/issues/233729)). @@ -53,12 +60,6 @@ groups: - My-reaction - Release - Type - - FLAG: - On self-managed GitLab, by default filtering by type is not available. - To make it available per group, ask an administrator to [enable the feature flag](../../administration/feature_flags.md) named `vue_issues_list`. - On GitLab.com, this feature is not available. - - Weight - Search for this text 1. Select or type the operator to use for filtering the attribute. The following operators are @@ -146,6 +147,10 @@ you can type (or select from the dropdown list) the following: - Deployed-before - Deployed-after +NOTE: +Projects using a [fast-forward merge method](../project/merge_requests/fast_forward_merge.md) +do not return results, as this method does not create a merge commit. + When filtering by an environment, a dropdown list presents all environments that you can choose from: @@ -207,10 +212,14 @@ You can also look for the projects you [starred](../project/working_with_project You can **Explore** all public and internal projects available in GitLab.com, from which you can filter by visibility, through **Trending**, best rated with **Most stars**, or **All** of them. -You can also sort them by **Name**, **Last created**, **Oldest created**, **Last updated**, -**Oldest updated**, **Owner**, and choose to hide or show **archived projects**: +You can also sort them by: + +- Name +- Created date +- Updated date +- Owner -![sort projects](img/sort_projects.png) +You can also choose to hide or show archived projects. ## Groups @@ -221,7 +230,7 @@ On the field **Filter by name**, type the group name you want to find, and GitLa filters them for you as you type. You can also **Explore** all public and internal groups available in GitLab.com, -and sort them by **Last created**, **Oldest created**, **Last updated**, or **Oldest updated**. +and sort them by **Name**, **Last created**, **Oldest created**, or **Updated date**. ## Issue boards @@ -246,7 +255,7 @@ In the search bar, you can view autocomplete suggestions for: - Recently viewed issues (try and type some word from the title of a recently viewed issue) - Recently viewed merge requests (try and type some word from the title of a recently viewed merge request) - Recently viewed epics (try and type some word from the title of a recently viewed epic) -- [GitLab Flavored Markdown](../markdown.md#gitlab-specific-references) (GFM) for issues in a project (try and type a GFM reference for an issue) +- [GitLab Flavored Markdown](../markdown.md#gitlab-specific-references) (GLFM) for issues in a project (try and type a GLFM reference for an issue) ## Basic search |