We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 793d698 commit 8f01bf4Copy full SHA for 8f01bf4
src/Share/Postgres/Queries.hs
@@ -179,6 +179,10 @@ searchProjects caller userIdFilter (Query query) limit = do
179
p.slug ILIKE (like_escape(#{query}) || '%') DESC,
180
-- Otherwise infix matches
181
p.slug ILIKE ('%' || like_escape(#{query}) || '%') DESC,
182
+ -- Prefer the caller's projects
183
+ COALESCE(FALSE, p.owner_user_id = #{caller}) DESC,
184
+ -- If a user has access to a private project, it's likely relevant
185
+ p.private DESC,
186
-- Prefer projects in the unison org
187
COALESCE(FALSE, p.owner_user_id = (SELECT unison.id FROM users unison WHERE unison.handle = 'unison')) DESC,
188
-- Prefer projects in the catalog
0 commit comments