Module: Gitlab::SQL::Pattern
- Extended by:
- ActiveSupport::Concern
- Included in:
- AlertManagement::Alert, Ci::Runner, ContainerRepository, CustomerRelations::Contact, CustomerRelations::Organization, Email, Issuable, Label, Namespace, Note, Operations::FeatureFlags::UserList, Packages::Package, PersonalAccessToken, Project, Projects::Topic, ProtectedBranch, Route, Snippet, Timebox, User
- Defined in:
- lib/gitlab/sql/pattern.rb
Constant Summary collapse
- MIN_CHARS_FOR_PARTIAL_MATCHING =
3
- REGEX_QUOTED_TERM =
/(?<=\A| )"[^"]+"(?= |\z)/
Class Method Summary collapse
Class Method Details
.split_query_to_search_terms(query) ⇒ Object
87 88 89 90 91 92 93 94 95 96 |
# File 'lib/gitlab/sql/pattern.rb', line 87 def self.split_query_to_search_terms(query) quoted_terms = [] query = query.gsub(REGEX_QUOTED_TERM) do |quoted_term| quoted_terms << quoted_term "" end query.split + quoted_terms.map { |quoted_term| quoted_term[1..-2] } end |