Verified Commit cc1fb450 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into 322-dev-flake-nix

parents df5dde1f 64e2a689
......@@ -28,8 +28,14 @@ get :: Text
-> IO (Either ClientError (Maybe Integer, ConduitT () HyperdataDocument IO ()))
get _email q lang mLimit = do
let limit = getLimit $ fromMaybe 1000 mLimit
let mFilter = (\l -> "language:" <> iso639ToText l) <$> lang
eRes <- OA.fetchWorksC Nothing mFilter $ Just $ Corpus.getRawQuery q
let filters =
[
-- see https://gitlab.iscpif.fr/gargantext/haskell-gargantext/issues/490
-- see https://openalex.org/works?page=1&filter=title_and_abstract.search:brain:hawai
Just ("title_and_abstract.search:" <> Corpus.getRawQuery q)
, (\l -> "language:" <> iso639ToText l) <$> lang
]
eRes <- OA.fetchWorksC Nothing (Just $ T.intercalate "," $ catMaybes filters) Nothing
pure $ (\(len, docsC) -> (len, docsC .| takeC limit .| mapC toDoc)) <$> eRes
toDoc :: OA.Work -> HyperdataDocument
......
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