Global search: Add *exact* search support (including common programming characters)
It's about the global search. We bought GitLab EE to be able to search for code across all repositories. Unfortunately, Gitlabs capabilities are limited right now.
Problem to solve
It is not possible to search for common "special characters" that are used in programming, like
( or a space
. However, a source code management system should be capable of this.
Including special characters/punctuation in a search is required when searching for code snippets, e.g. the Ruby spaceship operator
<=>. At other times, it might be necessary to include special characters or white space to distinguish two pieces of code. Example use case: Imagine a file
A/Gemfile.lock with content:
and a file
B/Gemfile.lock with content
and a search for
Gemfile.lock sanitize. Currently there is no way to filter the search results down to the result from A, without getting the Gemfile.lock from B too. Usually you would include the distinguishing characters in the search, but
Gemfile.lock "sanitize (" doesn't work. Quotes only mark "phrase matching".
Please refer to the support issue linked at the bottom, there is a screenshot (1) that demonstrates the issue.
Please add support to search for exact strings, or more specifically: support for "special" characters that are commonly used in code.
What does success look like, and how can we measure that?
In order to distinguish the substring "sanitize" (A) from "rails-html-sanitizer" (B), I would like to search for "sanitize (". Since the "sanitize" in B is followed by an "r", this search term should exclude matches for B.
Links / references
- support issue, processed by @astrachan: https://gitlab.zendesk.com/agent/tickets/99699
- updated docs: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6421