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
197
Issues
197
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
c9674b6e
Commit
c9674b6e
authored
Jul 01, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-list-charts' into dev-doc-table-optimization
parents
e982e379
ed5b5d35
Pipeline
#917
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+23
-2
No files found.
src/Gargantext/API/Ngrams.hs
View file @
c9674b6e
...
...
@@ -1216,14 +1216,23 @@ type RecomputeScoresNgramsApiGet = Summary " Recompute scores for ngrams table"
:>
QueryParamR
"list"
ListId
:>
"recompute"
:>
Post
'[
J
SON
]
Int
type
TableNgramsApiGetVersion
=
Summary
" Table Ngrams API Get Version"
:>
QueryParamR
"ngramsType"
TabType
:>
QueryParamR
"list"
ListId
:>
Get
'[
J
SON
]
Version
type
TableNgramsApi
=
TableNgramsApiGet
:<|>
TableNgramsApiPut
:<|>
TableNgramsApiPost
:<|>
RecomputeScoresNgramsApiGet
:<|>
"version"
:>
TableNgramsApiGetVersion
getTableNgramsCorpus
::
(
RepoCmdM
env
err
m
,
HasNodeError
err
,
HasConnectionPool
env
,
HasConfig
env
)
=>
NodeId
->
TabType
->
ListId
->
Limit
->
Maybe
Offset
=>
NodeId
->
TabType
->
ListId
->
Limit
->
Maybe
Offset
->
Maybe
ListType
->
Maybe
MinSize
->
Maybe
MaxSize
->
Maybe
OrderBy
...
...
@@ -1234,6 +1243,16 @@ getTableNgramsCorpus nId tabType listId limit_ offset listType minSize maxSize o
where
searchQuery
=
maybe
(
const
True
)
isInfixOf
mt
getTableNgramsVersion
::
(
RepoCmdM
env
err
m
,
HasNodeError
err
,
HasConnectionPool
env
,
HasConfig
env
)
=>
NodeId
->
TabType
->
ListId
->
m
Version
getTableNgramsVersion
nId
tabType
listId
=
do
-- TODO: limit?
Versioned
{
_v_version
=
v
}
<-
getTableNgramsCorpus
nId
tabType
listId
100000
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
pure
v
-- | Text search is deactivated for now for ngrams by doc only
getTableNgramsDoc
::
(
RepoCmdM
env
err
m
,
HasNodeError
err
,
HasConnectionPool
env
,
HasConfig
env
)
=>
DocId
->
TabType
...
...
@@ -1263,6 +1282,7 @@ apiNgramsTableCorpus cId = getTableNgramsCorpus cId
:<|>
tableNgramsPut
:<|>
tableNgramsPost
:<|>
scoresRecomputeTableNgrams
cId
:<|>
getTableNgramsVersion
cId
apiNgramsTableDoc
::
(
RepoCmdM
env
err
m
,
HasNodeError
err
...
...
@@ -1275,6 +1295,7 @@ apiNgramsTableDoc dId = getTableNgramsDoc dId
:<|>
tableNgramsPut
:<|>
tableNgramsPost
:<|>
scoresRecomputeTableNgrams
dId
:<|>
getTableNgramsVersion
dId
-- > add new ngrams in database (TODO AD)
-- > index all the corpus accordingly (TODO AD)
...
...
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