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
47ab0d5b
Commit
47ab0d5b
authored
Jan 21, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[OPTIM] Insert ngrams
parent
4d140947
Pipeline
#1372
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
Flow.hs
src/Gargantext/Database/Action/Flow.hs
+7
-10
No files found.
src/Gargantext/Database/Action/Flow.hs
View file @
47ab0d5b
...
...
@@ -448,19 +448,20 @@ indexAllDocumentsWithPosTag = do
corpusIds
<-
findNodesId
rootId
[
NodeCorpus
]
docs
<-
List
.
concat
<$>
mapM
getDocumentsWithParentId
corpusIds
printDebug
"Nb of docs"
(
List
.
length
docs
)
_
<-
mapM
extractInsert
(
splitEvery
1000
docs
)
pure
()
extractInsert
::
FlowCmdM
env
err
m
=>
[
Node
HyperdataDocument
]
->
m
()
extractInsert
docs
=
do
let
documentsWithId
=
map
(
\
doc
->
Indexed
(
doc
^.
node_id
)
doc
)
docs
mapNgramsDocs'
::
HashMap
ExtractedNgrams
(
Map
NgramsType
(
Map
NodeId
Int
))
<-
mapNodeIdNgrams
mapNgramsDocs'
<-
mapNodeIdNgrams
<$>
documentIdWithNgrams
(
extractNgramsT
$
withLang
(
Multi
EN
)
documentsWithId
)
documentsWithId
_
<-
mapM
insertExtractedNgrams
$
splitEvery
500
$
HashMap
.
keys
mapNgramsDocs'
_
<-
insertExtractedNgrams
$
HashMap
.
keys
mapNgramsDocs'
pure
()
...
...
@@ -471,7 +472,3 @@ indexAllDocumentsWithPosTag = do
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