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
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
Julien Moutinho
haskell-gargantext
Commits
b0ca0a6a
Commit
b0ca0a6a
authored
1 year ago
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/551-dev-graphql-contexts-ngrams' into dev-merge
parents
29592e7e
aa382ab1
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
docker-compose.yaml
devops/docker/docker-compose.yaml
+3
-0
NodeContext.hs
src/Gargantext/Database/Query/Table/NodeContext.hs
+14
-5
No files found.
devops/docker/docker-compose.yaml
View file @
b0ca0a6a
...
...
@@ -48,6 +48,8 @@ services:
-
postgres
links
:
-
postgres
volumes
:
-
pgadmin:/var/lib/pgadmin
corenlp
:
image
:
'
cgenie/corenlp-garg'
...
...
@@ -65,3 +67,4 @@ volumes:
#garg-pgdata:
garg-pgdata14
:
js-cache
:
pgadmin
:
This diff is collapsed.
Click to expand it.
src/Gargantext/Database/Query/Table/NodeContext.hs
View file @
b0ca0a6a
...
...
@@ -227,18 +227,27 @@ getContextNgramsMatchingFTS :: HasNodeError err
->
NodeId
->
Cmd
err
[
Text
]
getContextNgramsMatchingFTS
contextId
listId
=
do
res
<-
runPGSQuery
query
(
contextId
,
lis
tId
)
res
<-
runPGSQuery
query
(
listId
,
listId
,
contex
tId
)
pure
$
(
\
(
PGS
.
Only
term
)
->
term
)
<$>
res
where
query
::
PGS
.
Query
query
=
[
sql
|
SELECT ngrams.terms
query
=
[
sql
|
WITH ngrams_ids AS
(SELECT ngrams_id
FROM node_stories
WHERE node_id = ?
UNION SELECT ngrams_id
FROM node_ngrams
WHERE node_id = ?)
SELECT DISTINCT ngrams.terms
FROM ngrams
JOIN node_ngrams ON node_ngrams.ngrams_id = ngrams.id
JOIN ngrams_ids ON ngrams_ids.ngrams_id = ngrams.id
-- JOIN node_ngrams ON node_ngrams.ngrams_id = ngrams.id
CROSS JOIN contexts
WHERE contexts.id = ?
AND node_ngrams.node_id = ?
AND contexts.search @@ plainto_tsquery(ngrams.terms)
|]
-- AND node_ngrams.node_id = ?
AND (contexts.search @@ plainto_tsquery(ngrams.terms)
OR contexts.search @@ plainto_tsquery('french', ngrams.terms))
|]
------------------------------------------------------------------------
insertNodeContext
::
[
NodeContext
]
->
Cmd
err
Int
insertNodeContext
ns
=
mkCmd
$
\
conn
->
fromIntegral
<$>
(
runInsert_
conn
...
...
This diff is collapsed.
Click to expand it.
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