Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Przemyslaw Kaminski
haskell-gargantext
Commits
36b68d5c
Unverified
Commit
36b68d5c
authored
Jan 07, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NGRAMS-TABLE] comment out the weights
parent
92b7ab01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
NodeNgramsNgrams.hs
src/Gargantext/Database/Schema/NodeNgramsNgrams.hs
+8
-4
No files found.
src/Gargantext/Database/Schema/NodeNgramsNgrams.hs
View file @
36b68d5c
...
...
@@ -138,17 +138,21 @@ ngramsGroup action ngs = runNodeNgramsNgrams q ngs
runNodeNgramsNgrams
::
PGS
.
Query
->
[(
ListId
,
NgramsParent
,
NgramsChild
,
Maybe
Double
)]
->
Cmd
err
[
Int
]
runNodeNgramsNgrams
q
ngs
=
map
(
\
(
PGS
.
Only
a
)
->
a
)
<$>
runPGSQuery
q
(
PGS
.
Only
$
Values
fields
ngs'
)
where
ngs'
=
map
(
\
(
n
,
ng1
,
ng2
,
w
)
->
(
n
,
ng1
,
ng2
,
maybe
0
identity
w
))
ngs
ngs'
=
map
(
\
(
n
,
ng1
,
ng2
{-,w-}
)
->
(
n
,
ng1
,
ng2
{-,maybe 0 identity w-}
))
ngs
fields
=
map
(
\
t
->
QualifiedIdentifier
Nothing
t
)
[
"int4"
,
"text"
,
"text"
,
"double precision"
]
[
"int4"
,
"text"
,
"text"
{-,"double precision"-}
]
--------------------------------------------------------------------
-- TODO: on conflict update weight
queryInsertNodeNgramsNgrams
::
PGS
.
Query
queryInsertNodeNgramsNgrams
=
[
sql
|
WITH input_rows(nId,ng1,ng2,w) AS (?)
WITH input_rows(nId,ng1,ng2
-- ,w
) AS (?)
INSERT INTO nodes_ngrams_ngrams (node_id,ngram1_id,ngram2_id,weight)
SELECT nId,ngrams1.id,ngrams2.id,w FROM input_rows
SELECT nId,ngrams1.id,ngrams2.id
-- ,w
FROM input_rows
JOIN ngrams ngrams1 ON ngrams1.terms = ng1
JOIN ngrams ngrams2 ON ngrams2.terms = ng2
ON CONFLICT (node_id,ngram1_id,ngram2_id) DO NOTHING -- unique index created here
...
...
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