Search should compare only the lowercase versions of the project names
This commit is contained in:
parent
4bdcbc8598
commit
874ad681cd
|
@ -111,6 +111,7 @@ v 8.12.0 (unreleased)
|
|||
- Use default clone protocol on "check out, review, and merge locally" help page URL
|
||||
- API for Ci Lint !5953 (Katarzyna Kobierska Urszula Budziszewska)
|
||||
- Allow bulk update merge requests from merge requests index page
|
||||
- Project search API is now agnostic to casing
|
||||
|
||||
v 8.11.6 (unreleased)
|
||||
|
||||
|
|
|
@ -430,7 +430,7 @@ module API
|
|||
get "/search/:query" do
|
||||
ids = current_user.authorized_projects.map(&:id)
|
||||
visibility_levels = [ Gitlab::VisibilityLevel::INTERNAL, Gitlab::VisibilityLevel::PUBLIC ]
|
||||
projects = Project.where("(id in (?) OR visibility_level in (?)) AND (name LIKE (?))", ids, visibility_levels, "%#{params[:query]}%")
|
||||
projects = Project.where("(id in (?) OR visibility_level in (?)) AND (LOWER(name) LIKE LOWER((?)))", ids, visibility_levels, "%#{params[:query]}%")
|
||||
sort = params[:sort] == 'desc' ? 'desc' : 'asc'
|
||||
|
||||
projects = case params["order_by"]
|
||||
|
|
Loading…
Reference in New Issue