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
160
Issues
160
List
Board
Labels
Milestones
Merge Requests
14
Merge Requests
14
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
aa382ab1
Verified
Commit
aa382ab1
authored
Jun 07, 2023
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graphql ngrams] more permissive context ngrams matching fts
parent
111af128
Pipeline
#4163
passed with stages
in 71 minutes and 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
NodeContext.hs
src/Gargantext/Database/Query/Table/NodeContext.hs
+14
-5
No files found.
src/Gargantext/Database/Query/Table/NodeContext.hs
View file @
aa382ab1
...
...
@@ -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
...
...
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