Commit b3109276 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[ngrams] make ngrams search case-insensitive

parent afe1bf6d
Pipeline #3541 passed with stage
in 92 minutes and 4 seconds
......@@ -94,7 +94,7 @@ import Data.Monoid
import Data.Ord (Down(..))
import Data.Patch.Class (Action(act), Transformable(..), ours)
import Data.Swagger hiding (version, patch)
import Data.Text (Text, isInfixOf, unpack, pack)
import Data.Text (Text, isInfixOf, toLower, unpack, pack)
import Data.Text.Lazy.IO as DTL
import Formatting (hprint, int, (%))
import GHC.Generics (Generic)
......@@ -783,7 +783,7 @@ getTableNgramsCorpus :: (HasNodeStory env err m, HasNodeError err, HasConnection
getTableNgramsCorpus nId tabType listId limit_ offset listType minSize maxSize orderBy mt =
getTableNgrams NodeCorpus nId tabType listId limit_ offset listType minSize maxSize orderBy searchQuery
where
searchQuery (NgramsTerm nt) = maybe (const True) isInfixOf mt nt
searchQuery (NgramsTerm nt) = maybe (const True) isInfixOf (toLower <$> mt) (toLower nt)
......
......@@ -178,4 +178,3 @@ getPair cId ft o l order =
(Just Docs) -> runViewAuthorsDoc cId False o l order
(Just Trash) -> runViewAuthorsDoc cId True o l order
_ -> panic $ "not implemented: get Pairing" <> (cs $ show ft)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment