better search

This commit is contained in:
nek0 2017-10-21 15:53:43 +02:00
parent 9ce192b1a7
commit a723b0b62a
2 changed files with 6 additions and 3 deletions

View file

@ -31,8 +31,11 @@ getSearchR = do
searchForm searchForm
case res of case res of
FormSuccess query -> do FormSuccess query -> do
mediumList <- runDB $ mediumList <- runDB $ (++)
rawSql "select ?? from medium where title % ?" [PersistText query] rawSql "select ?? from medium where any(string_to_array(title, ' ') % ?"
[PersistText query]
rawSql "select ?? from medium where any(string_to_array(description, ' ') % ?"
[PersistText query]
userList <- runDB $ userList <- runDB $
rawSql "select ?? from \"user\" where name % ?" [PersistText query] rawSql "select ?? from \"user\" where name % ?" [PersistText query]
albumList <- runDB $ albumList <- runDB $

View file

@ -1,5 +1,5 @@
name: eidolon name: eidolon
version: 0.1.11.3 version: 0.1.11.4
synopsis: Image gallery in Yesod synopsis: Image gallery in Yesod
homepage: https://eidolon.nek0.eu homepage: https://eidolon.nek0.eu
license: AGPL-3 license: AGPL-3