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
148
Issues
148
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
5a3ebd2c
Commit
5a3ebd2c
authored
Jan 30, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API][Pairs] search enabled again.
parent
9f3feb43
Pipeline
#720
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
19 deletions
+22
-19
Node.hs
src/Gargantext/API/Node.hs
+5
-3
Search.hs
src/Gargantext/API/Search.hs
+17
-16
No files found.
src/Gargantext/API/Node.hs
View file @
5a3ebd2c
...
...
@@ -51,7 +51,7 @@ import Gargantext.API.Auth (withAccess, PathId(..))
import
Gargantext.API.Metrics
import
Gargantext.API.Ngrams
(
TabType
(
..
),
TableNgramsApi
,
apiNgramsTableCorpus
,
QueryParamR
)
import
Gargantext.API.Ngrams.NTree
(
MyTree
)
import
Gargantext.API.Search
(
SearchDocsAPI
,
searchDocs
)
import
Gargantext.API.Search
(
SearchDocsAPI
,
searchDocs
,
SearchPairsAPI
,
searchPairs
)
import
Gargantext.API.Table
import
Gargantext.API.Types
import
Gargantext.Core.Types
(
NodeTableResult
)
...
...
@@ -131,7 +131,8 @@ type NodeAPI a = Get '[JSON] (Node a)
:<|>
"pairing"
:>
PairingApi
:<|>
"category"
:>
CatApi
:<|>
"search"
:>
SearchDocsAPI
:<|>
"search"
:>
SearchDocsAPI
:<|>
"searchPair"
:>
SearchPairsAPI
-- VIZ
:<|>
"metrics"
:>
ScatterAPI
...
...
@@ -193,7 +194,8 @@ nodeAPI p uId id = withAccess (Proxy :: Proxy (NodeAPI a)) Proxy uId (PathNode i
:<|>
catApi
id
:<|>
searchDocs
id
:<|>
searchDocs
id
:<|>
searchPairs
id
:<|>
getScatter
id
:<|>
getChart
id
...
...
src/Gargantext/API/Search.hs
View file @
5a3ebd2c
...
...
@@ -79,27 +79,28 @@ instance ToSchema SearchPairedResults where
-----------------------------------------------------------------------
-- TODO-ACCESS: CanSearch? or is it part of CanGetNode
-- TODO-EVENTS: No event, this is a read-only query.
type
SearchAPI
results
=
Summary
"Search endpoint"
:>
ReqBody
'[
J
SON
]
SearchQuery
:>
QueryParam
"offset"
Int
:>
QueryParam
"limit"
Int
:>
QueryParam
"order"
OrderBy
:>
Post
'[
J
SON
]
results
type
SearchAPI
results
=
Summary
"Search endpoint"
:>
ReqBody
'[
J
SON
]
SearchQuery
:>
QueryParam
"offset"
Int
:>
QueryParam
"limit"
Int
:>
QueryParam
"order"
OrderBy
:>
Post
'[
J
SON
]
results
type
SearchDocsAPI
=
SearchAPI
SearchDocResults
type
SearchPairsAPI
=
Summary
""
:>
"list"
:>
Capture
"list"
ListId
:>
SearchAPI
SearchPairedResults
-----------------------------------------------------------------------
searchPairs
::
NodeId
->
GargServer
SearchPairsAPI
searchPairs
pId
lId
(
SearchQuery
q
)
o
l
order
=
SearchPairedResults
<$>
searchInCorpusWithContacts
pId
lId
q
o
l
order
searchDocs
::
NodeId
->
GargServer
SearchDocsAPI
searchDocs
nId
(
SearchQuery
q
)
o
l
order
=
SearchDocResults
<$>
searchInCorpus
nId
False
q
o
l
order
--SearchResults <$> searchInCorpusWithContacts nId q o l order
-----------------------------------------------------------------------
type
SearchPairsAPI
=
Summary
""
:>
"list"
:>
Capture
"list"
ListId
:>
SearchAPI
SearchPairedResults
searchPairs
::
NodeId
->
GargServer
SearchPairsAPI
searchPairs
pId
lId
(
SearchQuery
q
)
o
l
order
=
SearchPairedResults
<$>
searchInCorpusWithContacts
pId
lId
q
o
l
order
-----------------------------------------------------------------------
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