Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
090eeb58
Commit
090eeb58
authored
Feb 15, 2018
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added changelog for user search improvements
parent
41bfe82b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
app/finders/autocomplete_users_finder.rb
app/finders/autocomplete_users_finder.rb
+1
-1
changelogs/unreleased/users-autocomplete.yml
changelogs/unreleased/users-autocomplete.yml
+5
-0
lib/gitlab/sql/pattern.rb
lib/gitlab/sql/pattern.rb
+2
-4
No files found.
app/finders/autocomplete_users_finder.rb
View file @
090eeb58
...
...
@@ -58,7 +58,7 @@ class AutocompleteUsersFinder
def
users_from_project
if
author_id
.
present?
union
=
Gitlab
::
SQL
::
Union
.
new
([
project
.
team
.
users
,
User
.
where
(
id:
author_id
)])
.
new
([
project
.
authorized_
users
,
User
.
where
(
id:
author_id
)])
User
.
from
(
"(
#{
union
.
to_sql
}
)
#{
User
.
table_name
}
"
)
else
...
...
changelogs/unreleased/users-autocomplete.yml
0 → 100644
View file @
090eeb58
---
title
:
Improve performance of searching for and autocompleting of users
merge_request
:
author
:
type
:
performance
lib/gitlab/sql/pattern.rb
View file @
090eeb58
...
...
@@ -38,16 +38,14 @@ module Gitlab
if
words
.
any?
words
.
map
{
|
word
|
arel_table
[
column
].
matches
(
to_pattern
(
word
))
}.
reduce
(
:and
)
else
sanitized_query
=
sanitize_sql_like
(
query
)
# No words of at least 3 chars, but we can search for an exact
# case insensitive match with the query as a whole
if
lower_exact_match
Arel
::
Nodes
::
NamedFunction
.
new
(
'LOWER'
,
[
arel_table
[
column
]])
.
eq
(
sanitized_
query
)
.
eq
(
query
)
else
arel_table
[
column
].
matches
(
sanitize
d_query
)
arel_table
[
column
].
matches
(
sanitize
_sql_like
(
query
)
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment