Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
199
Issues
199
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
c05efd19
Verified
Commit
c05efd19
authored
Jul 08, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[openalex] make search act similar to the one on openalex web
See
#490
parent
397b19a5
Pipeline
#7727
passed with stages
in 59 minutes and 28 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
OpenAlex.hs
src/Gargantext/Core/Text/Corpus/API/OpenAlex.hs
+8
-2
No files found.
src/Gargantext/Core/Text/Corpus/API/OpenAlex.hs
View file @
c05efd19
...
@@ -28,8 +28,14 @@ get :: Text
...
@@ -28,8 +28,14 @@ get :: Text
->
IO
(
Either
ClientError
(
Maybe
Integer
,
ConduitT
()
HyperdataDocument
IO
()
))
->
IO
(
Either
ClientError
(
Maybe
Integer
,
ConduitT
()
HyperdataDocument
IO
()
))
get
_email
q
lang
mLimit
=
do
get
_email
q
lang
mLimit
=
do
let
limit
=
getLimit
$
fromMaybe
1000
mLimit
let
limit
=
getLimit
$
fromMaybe
1000
mLimit
let
mFilter
=
(
\
l
->
"language:"
<>
iso639ToText
l
)
<$>
lang
let
filters
=
eRes
<-
OA
.
fetchWorksC
Nothing
mFilter
$
Just
$
Corpus
.
getRawQuery
q
[
-- 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
)
(
Just
$
Corpus
.
getRawQuery
q
)
pure
$
(
\
(
len
,
docsC
)
->
(
len
,
docsC
.|
takeC
limit
.|
mapC
toDoc
))
<$>
eRes
pure
$
(
\
(
len
,
docsC
)
->
(
len
,
docsC
.|
takeC
limit
.|
mapC
toDoc
))
<$>
eRes
toDoc
::
OA
.
Work
->
HyperdataDocument
toDoc
::
OA
.
Work
->
HyperdataDocument
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment