Added changelog for user search improvements
This commit is contained in:
parent
41bfe82b7a
commit
090eeb581b
|
@ -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
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Improve performance of searching for and autocompleting of users
|
||||
merge_request:
|
||||
author:
|
||||
type: performance
|
|
@ -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(sanitized_query)
|
||||
arel_table[column].matches(sanitize_sql_like(query))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue