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
195
Issues
195
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
2b2231cb
Commit
2b2231cb
authored
Nov 24, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Graph Explorer search waiting for the search in docs with ngrams and our TFIDF
parent
da954a33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
Search.hs
src/Gargantext/API/Search.hs
+6
-5
Search.hs
src/Gargantext/Database/Action/Search.hs
+0
-1
No files found.
src/Gargantext/API/Search.hs
View file @
2b2231cb
...
@@ -18,7 +18,7 @@ module Gargantext.API.Search
...
@@ -18,7 +18,7 @@ module Gargantext.API.Search
where
where
import
Data.Aeson
hiding
(
defaultTaggedObject
)
import
Data.Aeson
hiding
(
defaultTaggedObject
)
import
Data.List
(
concat
)
--
import Data.List (concat)
import
Data.Maybe
(
fromMaybe
)
import
Data.Maybe
(
fromMaybe
)
import
Data.Swagger
hiding
(
fieldLabelModifier
,
Contact
)
import
Data.Swagger
hiding
(
fieldLabelModifier
,
Contact
)
import
Data.Text
(
Text
)
import
Data.Text
(
Text
)
...
@@ -56,7 +56,8 @@ api :: NodeId -> GargServer (API SearchResult)
...
@@ -56,7 +56,8 @@ api :: NodeId -> GargServer (API SearchResult)
api
nId
(
SearchQuery
q
SearchDoc
)
o
l
order
=
api
nId
(
SearchQuery
q
SearchDoc
)
o
l
order
=
SearchResult
<$>
SearchResultDoc
SearchResult
<$>
SearchResultDoc
<$>
map
(
toRow
nId
)
<$>
map
(
toRow
nId
)
<$>
searchInCorpus
nId
False
(
concat
q
)
o
l
order
<$>
searchInCorpus
nId
False
q
o
l
order
-- <$> searchInCorpus nId False (concat q) o l order
api
nId
(
SearchQuery
q
SearchContact
)
o
l
order
=
do
api
nId
(
SearchQuery
q
SearchContact
)
o
l
order
=
do
printDebug
"isPairedWith"
nId
printDebug
"isPairedWith"
nId
...
@@ -68,7 +69,7 @@ api nId (SearchQuery q SearchContact) o l order = do
...
@@ -68,7 +69,7 @@ api nId (SearchQuery q SearchContact) o l order = do
Just
aId
->
SearchResult
Just
aId
->
SearchResult
<$>
SearchResultContact
<$>
SearchResultContact
<$>
map
(
toRow
aId
)
<$>
map
(
toRow
aId
)
<$>
searchInCorpusWithContacts
nId
aId
(
concat
q
)
o
l
order
<$>
searchInCorpusWithContacts
nId
aId
q
o
l
order
api
_nId
(
SearchQuery
_q
SearchDocWithNgrams
)
_o
_l
_order
=
undefined
api
_nId
(
SearchQuery
_q
SearchDocWithNgrams
)
_o
_l
_order
=
undefined
...
@@ -88,7 +89,7 @@ instance Arbitrary SearchType where
...
@@ -88,7 +89,7 @@ instance Arbitrary SearchType where
-----------------------------------------------------------------------
-----------------------------------------------------------------------
data
SearchQuery
=
data
SearchQuery
=
SearchQuery
{
query
::
!
[
[
Text
]
]
SearchQuery
{
query
::
!
[
Text
]
,
expected
::
!
SearchType
,
expected
::
!
SearchType
}
}
deriving
(
Generic
)
deriving
(
Generic
)
...
@@ -103,7 +104,7 @@ instance ToSchema SearchQuery
...
@@ -103,7 +104,7 @@ instance ToSchema SearchQuery
-}
-}
instance
Arbitrary
SearchQuery
where
instance
Arbitrary
SearchQuery
where
arbitrary
=
elements
[
SearchQuery
[
[
"electrodes"
]
]
SearchDoc
]
arbitrary
=
elements
[
SearchQuery
[
"electrodes"
]
SearchDoc
]
-- arbitrary = elements [SearchQuery "electrodes" 1 ] --SearchDoc]
-- arbitrary = elements [SearchQuery "electrodes" 1 ] --SearchDoc]
-----------------------------------------------------------------------
-----------------------------------------------------------------------
data
SearchResult
=
data
SearchResult
=
...
...
src/Gargantext/Database/Action/Search.hs
View file @
2b2231cb
...
@@ -58,7 +58,6 @@ searchDocInDatabase p t = runOpaQuery (queryDocInDatabase p t)
...
@@ -58,7 +58,6 @@ searchDocInDatabase p t = runOpaQuery (queryDocInDatabase p t)
returnA
-<
(
_ns_id
row
,
_ns_hyperdata
row
)
returnA
-<
(
_ns_id
row
,
_ns_hyperdata
row
)
------------------------------------------------------------------------
------------------------------------------------------------------------
-- | Search ngrams in documents, ranking them by TF-IDF. We narrow our
-- | Search ngrams in documents, ranking them by TF-IDF. We narrow our
-- search only to map/candidate terms.
-- search only to map/candidate terms.
searchInCorpusWithNgrams
::
HasDBid
NodeType
searchInCorpusWithNgrams
::
HasDBid
NodeType
...
...
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