From 216b7746a6354cc84ea4cf3c846f9b4dec76d79c Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 14 Feb 2020 13:38:45 +0000 Subject: [PATCH] Lazy match aliases, add TODOs --- publicroomsapi/storage/sqlite3/public_rooms_table.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/publicroomsapi/storage/sqlite3/public_rooms_table.go b/publicroomsapi/storage/sqlite3/public_rooms_table.go index a25c01c9e..3fe3d3cab 100644 --- a/publicroomsapi/storage/sqlite3/public_rooms_table.go +++ b/publicroomsapi/storage/sqlite3/public_rooms_table.go @@ -73,8 +73,8 @@ const selectPublicRoomsWithFilterSQL = "" + " FROM publicroomsapi_public_rooms" + " WHERE visibility = true" + " AND (LOWER(name) LIKE LOWER($1)" + - " OR LOWER(topic) LIKE LOWER($1))" + - //" OR LOWER(ARRAY_TO_STRING(aliases, ',')) LIKE LOWER($1))" + + " OR LOWER(topic) LIKE LOWER($1)" + + " OR LOWER(aliases) LIKE LOWER($1))" + // TODO: Is there a better way to search aliases? " ORDER BY joined_members DESC" + " LIMIT 30 OFFSET $2" @@ -83,8 +83,8 @@ const selectPublicRoomsWithLimitAndFilterSQL = "" + " FROM publicroomsapi_public_rooms" + " WHERE visibility = true" + " AND (LOWER(name) LIKE LOWER($1)" + - " OR LOWER(topic) LIKE LOWER($1))" + - // " OR LOWER(ARRAY_TO_STRING(aliases, ',')) LIKE LOWER($1))" + + " OR LOWER(topic) LIKE LOWER($1)" + + " OR LOWER(aliases) LIKE LOWER($1))" + // TODO: Is there a better way to search aliases? " ORDER BY joined_members DESC" + " LIMIT $3 OFFSET $2"