@@ -974,7 +974,14 @@ rowToUser UserRow{..} = User {
974974 }
975975
976976queryFromText :: Text -> Text
977−queryFromText = T.unwords . L.intersperse "&" . map (`T.append` ":*") . filter (not . T.null) . T.split (not . isAlphaNum)
977+queryFromText = T.unwords . L.intersperse "&" . map processTerm . filter (not . T.null) . T.split (not . isAlphaNum)
978+ where
979+ processTerm :: Text -> Text
980+ processTerm t = "(" <> t <> ":*" <> (
981+ if T.length t <= 5
982+ then (" | (" <>) . (<> ")") . T.unwords . L.intersperse "<->" . map (<> ":*") . map T.singleton . T.unpack $ t
983+ else mempty
984+ ) <> ")"
978985
979986directionToOperator
980987 :: P.PaginationDirection