From 13583d393b6d1d4155082955b0e81868467b7b3e Mon Sep 17 00:00:00 2001 From: Luis Borjas Reyes Date: Mon, 25 Jan 2021 02:05:17 -0500 Subject: [PATCH 1/2] ignore `seeds` dir in docker --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index a68a279..5025944 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,3 +5,4 @@ dist-newstyle/ Dockerfile .dockerignore .git/ +seeds/ From fe6381fb0a53638c046bc4d42f94765eefddc348 Mon Sep 17 00:00:00 2001 From: Luis Borjas Reyes Date: Thu, 28 Jan 2021 02:31:19 -0500 Subject: [PATCH 2/2] Late-night amendment to autocomplete query Slower, but better? --- src/Database/Queries.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Database/Queries.hs b/src/Database/Queries.hs index c05e541..82b4dcf 100644 --- a/src/Database/Queries.hs +++ b/src/Database/Queries.hs @@ -47,9 +47,9 @@ findApiKey key = do cityAutoComplete :: Has Database sig m => Text -> Maybe Int -> m [CityQ] cityAutoComplete q limit' = do let limit = defaultLimit 5 limit' - query - "select * from geocode.city_autocomplete where name %> ? limit ?" - (q, limit) + query + "select * from geocode.city_autocomplete where name %> ? order by name <-> ?, population desc limit ?" + (q, q, limit) -- | Slightly slower, but more precise, query to find a city that -- partially matches a name: it looks at alternate names, and