summaryrefslogtreecommitdiff
path: root/doc/user/search
diff options
context:
space:
mode:
Diffstat (limited to 'doc/user/search')
-rw-r--r--doc/user/search/advanced_global_search.md19
-rw-r--r--doc/user/search/advanced_search_syntax.md48
-rw-r--r--doc/user/search/img/project_code_search.pngbin0 -> 24924 bytes
-rw-r--r--doc/user/search/img/project_search_dropdown.pngbin0 -> 117963 bytes
-rw-r--r--doc/user/search/index.md29
5 files changed, 59 insertions, 37 deletions
diff --git a/doc/user/search/advanced_global_search.md b/doc/user/search/advanced_global_search.md
index 820d66e4cd6..53ec8b35631 100644
--- a/doc/user/search/advanced_global_search.md
+++ b/doc/user/search/advanced_global_search.md
@@ -5,12 +5,12 @@ info: "To determine the technical writer assigned to the Stage/Group associated
type: reference
---
-# Advanced Global Search **(STARTER)**
+# Advanced Search **(STARTER)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/109) in GitLab [Starter](https://about.gitlab.com/pricing/) 8.4.
NOTE: **GitLab.com availability:**
-Advanced Global Search (powered by Elasticsearch) is enabled for Bronze and above on GitLab.com since 2020-07-10.
+Advanced Search (powered by Elasticsearch) is enabled for Bronze and above on GitLab.com since 2020-07-10.
Leverage Elasticsearch for faster, more advanced code search across your entire
GitLab instance.
@@ -20,7 +20,7 @@ visit the [administrator documentation](../../integration/elasticsearch.md).
## Overview
-The Advanced Global Search in GitLab is a powerful search service that saves
+The Advanced Search in GitLab is a powerful search service that saves
you time. Instead of creating duplicate code and wasting time, you can
now search for code within other projects that can help your own project.
@@ -39,12 +39,15 @@ searching in:
## Use cases
-The Advanced Global Search can be useful in various scenarios.
+The Advanced Search can be useful in various scenarios.
### Faster searches
If you are dealing with huge amount of data and want to keep GitLab's search
-fast, the Advanced Global Search will help you achieve that.
+fast, Advanced Search will help you achieve that.
+
+NOTE: **Note:**
+Between versions 12.10 and 13.4, Advanced Search response times have improved by 80%.
### Promote innersourcing
@@ -58,13 +61,13 @@ throughout the GitLab instance and find the code they search for.
Just use the search as before and GitLab will show you matching code from each
project you have access to.
-![Advanced Global Search](img/advanced_global_search.png)
+![Advanced Search](img/advanced_global_search.png)
-You can also use the [Advanced Syntax Search](advanced_search_syntax.md) which
+You can also use the [Advanced Search Syntax](advanced_search_syntax.md) which
provides some useful queries.
NOTE: **Note:**
Elasticsearch has only data for the default branch. 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 will be served by the regular
+then the "Code" tab in the search result page will be served by the basic
search even if Elasticsearch is enabled.
diff --git a/doc/user/search/advanced_search_syntax.md b/doc/user/search/advanced_search_syntax.md
index d8fce3223ed..804d4c540ac 100644
--- a/doc/user/search/advanced_search_syntax.md
+++ b/doc/user/search/advanced_search_syntax.md
@@ -5,12 +5,12 @@ info: "To determine the technical writer assigned to the Stage/Group associated
type: reference
---
-# Advanced Syntax Search **(STARTER)**
+# Advanced Search Syntax **(STARTER)**
> - Introduced in [GitLab Enterprise Starter](https://about.gitlab.com/pricing/) 9.2
NOTE: **GitLab.com availability:**
-Advanced Global Search (powered by Elasticsearch) is enabled for Bronze and above on GitLab.com since 2020-07-10.
+Advanced Search (powered by Elasticsearch) is enabled for Bronze and above on GitLab.com since 2020-07-10.
Use advanced queries for more targeted search results.
@@ -19,11 +19,11 @@ visit the [administrator documentation](../../integration/elasticsearch.md).
## Overview
-The Advanced Syntax Search is a subset of the
-[Advanced Global Search](advanced_global_search.md), which you can use if you
+The Advanced Search Syntax is a subset of the
+[Advanced Search](advanced_global_search.md), which you can use if you
want to have more specific search results.
-Advanced Global Search only supports searching the [default branch](../project/repository/branches/index.md#default-branch).
+Advanced Search only supports searching the [default branch](../project/repository/branches/index.md#default-branch).
## Use cases
@@ -38,26 +38,26 @@ not so sure.
In that case, using the advanced search syntax in your query will yield much
better results.
-## Using the Advanced Syntax Search
+## Using the Advanced Search Syntax
-The Advanced Syntax Search supports fuzzy or exact search queries with prefixes,
+The Advanced Search Syntax supports fuzzy or exact search queries with prefixes,
boolean operators, and much more.
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 - e.g.: searching
- issues for `display bug` will return all issues matching both those words, in any order.
-- To find the exact phrase (stemming still applies), use double quotes: `"display bug"`
-- To find bugs not mentioning display, use `-`: `bug -display`
-- To find a bug in display or sound, use `|`: `bug display | sound`
-- To group terms together, use parentheses: `bug | (display +sound)`
-- To match a partial word, use `*`: `bug find_by_*`
-- To find a term containing one of these symbols, use `\`: `argument \-last`
+ issues for [`display bug`](https://gitlab.com/search?utf8=%E2%9C%93&snippets=&scope=issues&repository_ref=&search=display+bug&group_id=9970&project_id=278964) and [`bug display`](https://gitlab.com/search?utf8=%E2%9C%93&snippets=&scope=issues&repository_ref=&search=bug+Display&group_id=9970&project_id=278964) will return the same results.
+- To find the exact phrase (stemming still applies), use double quotes: [`"display bug"`](https://gitlab.com/search?utf8=%E2%9C%93&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?utf8=%E2%9C%93&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?utf8=%E2%9C%93&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?utf8=%E2%9C%93&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?utf8=%E2%9C%93&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?utf8=%E2%9C%93&snippets=&scope=blobs&repository_ref=&search=argument+%5C-last&group_id=9970&project_id=278964)
### Syntax search filters
-The Advanced Syntax Search also supports the use of filters. The available filters are:
+The Advanced Search Syntax 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.
@@ -68,11 +68,11 @@ To use them, simply add them to your query in the format `<filter_name>:<value>`
Examples:
-- Finding a file with any content named `hello_world.rb`: `* filename:hello_world.rb`
-- Finding a file named `hello_world` with the text `whatever` inside of it: `whatever filename:hello_world`
-- Finding the text 'def create' inside files with the `.rb` extension: `def create extension:rb`
-- Finding the text `sha` inside files in a folder called `encryption`: `sha path:encryption`
-- Finding any file starting with `hello` containing `world` and with the `.js` extension: `world filename:hello* extension:js`
+- Finding a file with any content named `search_results.rb`: [`* filename:search_results.rb`](https://gitlab.com/search?utf8=%E2%9C%93&snippets=&scope=blobs&repository_ref=&search=*+filename%3Asearch_results.rb&group_id=9970&project_id=278964)
+- 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?utf8=%E2%9C%93&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?utf8=%E2%9C%93&snippets=&scope=blobs&repository_ref=&search=EpicLinks+extension%3Arb&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?utf8=%E2%9C%93&snippets=&scope=blobs&repository_ref=&search=Sidekiq+path%3Aelastic&group_id=9970&project_id=278964)
+- 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?utf8=%E2%9C%93&snippets=&scope=blobs&repository_ref=&search=eventHub+filename%3Asearch*+extension%3Ajs&group_id=9970&project_id=278964)
#### Excluding filters
@@ -86,7 +86,7 @@ Filters can be inversed to **filter out** results from the result set, by prefix
Examples:
-- Finding `rails` in all files but `Gemfile.lock`: `rails -filename:Gemfile.lock`
-- Finding `success` in all files excluding `.po|pot` files: `success -filename:*.po*`
-- Finding `import` excluding minified JavaScript (`.min.js`) files: `import -extension:min.js`
-- Finding `docs` for all files outside the `docs/` folder: `docs -path:docs/`
+- Finding `rails` in all files but `Gemfile.lock`: [`rails -filename:Gemfile.lock`](https://gitlab.com/search?utf8=%E2%9C%93&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?utf8=%E2%9C%93&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?utf8=%E2%9C%93&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?utf8=%E2%9C%93&snippets=&scope=blobs&repository_ref=&search=docs+-path%3Adocs%2F&group_id=9970&project_id=278964)
diff --git a/doc/user/search/img/project_code_search.png b/doc/user/search/img/project_code_search.png
new file mode 100644
index 00000000000..5412f614a74
--- /dev/null
+++ b/doc/user/search/img/project_code_search.png
Binary files differ
diff --git a/doc/user/search/img/project_search_dropdown.png b/doc/user/search/img/project_search_dropdown.png
new file mode 100644
index 00000000000..e0b922a186b
--- /dev/null
+++ b/doc/user/search/img/project_search_dropdown.png
Binary files differ
diff --git a/doc/user/search/index.md b/doc/user/search/index.md
index 98b34fe8383..475a72385ac 100644
--- a/doc/user/search/index.md
+++ b/doc/user/search/index.md
@@ -49,7 +49,7 @@ groups:
- My-reaction
- Confidential
- Epic ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/195704) in GitLab 12.9),
- including [child epic](../group/epics/index.md#multi-level-child-epics-ultimate)
+ including [child epic](../group/epics/index.md#multi-level-child-epics)
([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/9029) in
[GitLab Ultimate](https://about.gitlab.com/pricing/) 13.0)
- Search for this text
@@ -129,6 +129,14 @@ characters to begin your search. For example, if you want to search for
issues that have the assignee "Simone Presley", you'll need to type at
least "Sim" before autocomplete gives any relevant results.
+## Code search
+
+To search through code or other documents in a single project, you can use
+the search field on the top-right of your screen while the project page is open.
+
+![code search dropdown](img/project_search_dropdown.png)
+![code search results](img/project_code_search.png)
+
## Search history
You can view recent searches by clicking on the little arrow-clock icon, which is to the left of the search input. Click the search entry to run that search again. This feature is available for issues and merge requests. Searches are stored locally in your browser.
@@ -154,6 +162,17 @@ quickly access issues and merge requests created or assigned to you within that
![search per project - shortcut](img/project_search.png)
+### Autocomplete suggestions
+
+You can also type in this search bar to see autocomplete suggestions for:
+
+- Projects and groups
+- Various help pages (try and type **API help**)
+- Project feature pages (try and type **milestones**)
+- Various settings pages (try and type **user settings**)
+- 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 merge request)
+
## To-Do List
Your [To-Do List](../todos.md#gitlab-to-do-list) can be searched by "to do" and "done".
@@ -200,15 +219,15 @@ and **Labels**, select multiple issues to add to a list of your choice:
![search and select issues to add to board](img/search_issues_board.png)
-## Advanced Global Search **(STARTER)**
+## Advanced Search **(STARTER)**
Leverage Elasticsearch for faster, more advanced code search across your entire
GitLab instance.
-[Learn how to use the Advanced Global Search.](advanced_global_search.md)
+[Learn how to use the Advanced Search.](advanced_global_search.md)
-## Advanced Syntax Search **(STARTER)**
+## Advanced Search Syntax **(STARTER)**
Use advanced queries for more targeted search results.
-[Learn how to use the Advanced Syntax Search.](advanced_search_syntax.md)
+[Learn how to use the Advanced Search Syntax.](advanced_search_syntax.md)