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
919007df
Commit
919007df
authored
Jul 25, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CLEAN] removing old queries
parent
b3ad95a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
24 deletions
+5
-24
Search.hs
src/Gargantext/Database/Action/Search.hs
+5
-24
No files found.
src/Gargantext/Database/Action/Search.hs
View file @
919007df
...
...
@@ -115,30 +115,11 @@ searchInCorpusWithContacts cId aId q o l _order =
runOpaQuery
$
limit'
l
$
offset'
o
$
orderBy
(
desc
_fp_score
)
$
g
roup
cId
aId
$
selectG
roup
cId
aId
$
intercalate
" | "
$
map
stemIt
q
-- TODO group by
selectContactViaDoc
::
CorpusId
->
AnnuaireId
->
Text
->
Select
FacetPairedReadNull
selectContactViaDoc
cId
aId
q
=
proc
()
->
do
(
doc
,
(
corpus_doc
,
(
_contact_doc
,
(
annuaire_contact
,
contact
))))
<-
queryContactViaDoc
-<
()
restrict
-<
(
doc
^.
ns_search
)
@@
(
pgTSQuery
$
unpack
q
)
restrict
-<
(
doc
^.
ns_typename
)
.==
(
pgInt4
$
nodeTypeId
NodeDocument
)
restrict
-<
(
corpus_doc
^.
nn_node1_id
)
.==
(
toNullable
$
pgNodeId
cId
)
restrict
-<
(
annuaire_contact
^.
nn_node1_id
)
.==
(
toNullable
$
pgNodeId
aId
)
restrict
-<
(
contact
^.
node_typename
)
.==
(
toNullable
$
pgInt4
$
nodeTypeId
NodeContact
)
returnA
-<
FacetPaired
(
contact
^.
node_id
)
(
contact
^.
node_date
)
(
contact
^.
node_hyperdata
)
(
toNullable
$
pgInt4
1
)
selectContactViaDoc'
::
CorpusId
->
AnnuaireId
->
Text
...
...
@@ -148,7 +129,7 @@ selectContactViaDoc'
,
Column
(
Nullable
PGJsonb
)
,
Column
(
Nullable
PGInt4
)
)
selectContactViaDoc
'
cId
aId
q
=
proc
()
->
do
selectContactViaDoc
cId
aId
q
=
proc
()
->
do
(
doc
,
(
corpus_doc
,
(
_contact_doc
,
(
annuaire_contact
,
contact
))))
<-
queryContactViaDoc
-<
()
restrict
-<
(
doc
^.
ns_search
)
@@
(
pgTSQuery
$
unpack
q
)
restrict
-<
(
doc
^.
ns_typename
)
.==
(
pgInt4
$
nodeTypeId
NodeDocument
)
...
...
@@ -161,13 +142,13 @@ selectContactViaDoc' cId aId q = proc () -> do
,
toNullable
$
pgInt4
1
)
g
roup
::
NodeId
selectG
roup
::
NodeId
->
NodeId
->
Text
->
Select
FacetPairedReadNull
g
roup
cId
aId
q
=
proc
()
->
do
selectG
roup
cId
aId
q
=
proc
()
->
do
(
a
,
b
,
c
,
d
)
<-
aggregate
(
p4
(
groupBy
,
groupBy
,
groupBy
,
O
.
sum
))
(
selectContactViaDoc
'
cId
aId
q
)
-<
()
(
selectContactViaDoc
cId
aId
q
)
-<
()
returnA
-<
FacetPaired
a
b
c
d
...
...
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