Lazy match aliases, add TODOs

This commit is contained in:
Neil Alexander 2020-02-14 13:38:45 +00:00
parent d043b98ff0
commit 216b7746a6

View file

@ -73,8 +73,8 @@ const selectPublicRoomsWithFilterSQL = "" +
" FROM publicroomsapi_public_rooms" + " FROM publicroomsapi_public_rooms" +
" WHERE visibility = true" + " WHERE visibility = true" +
" AND (LOWER(name) LIKE LOWER($1)" + " AND (LOWER(name) LIKE LOWER($1)" +
" OR LOWER(topic) LIKE LOWER($1))" + " OR LOWER(topic) LIKE LOWER($1)" +
//" OR LOWER(ARRAY_TO_STRING(aliases, ',')) LIKE LOWER($1))" + " OR LOWER(aliases) LIKE LOWER($1))" + // TODO: Is there a better way to search aliases?
" ORDER BY joined_members DESC" + " ORDER BY joined_members DESC" +
" LIMIT 30 OFFSET $2" " LIMIT 30 OFFSET $2"
@ -83,8 +83,8 @@ const selectPublicRoomsWithLimitAndFilterSQL = "" +
" FROM publicroomsapi_public_rooms" + " FROM publicroomsapi_public_rooms" +
" WHERE visibility = true" + " WHERE visibility = true" +
" AND (LOWER(name) LIKE LOWER($1)" + " AND (LOWER(name) LIKE LOWER($1)" +
" OR LOWER(topic) LIKE LOWER($1))" + " OR LOWER(topic) LIKE LOWER($1)" +
// " OR LOWER(ARRAY_TO_STRING(aliases, ',')) LIKE LOWER($1))" + " OR LOWER(aliases) LIKE LOWER($1))" + // TODO: Is there a better way to search aliases?
" ORDER BY joined_members DESC" + " ORDER BY joined_members DESC" +
" LIMIT $3 OFFSET $2" " LIMIT $3 OFFSET $2"