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
baa2491f
Verified
Commit
baa2491f
authored
Jan 07, 2025
by
Przemyslaw Kaminski
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[refactor] searx search refactoring
parent
fcf83bf7
Pipeline
#7188
passed with stages
in 44 minutes and 54 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
17 deletions
+5
-17
Searx.hs
src/Gargantext/API/Node/Corpus/Searx.hs
+4
-14
Extract.hs
src/Gargantext/Database/Action/Flow/Extract.hs
+1
-1
Utils.hs
src/Gargantext/Database/Action/Flow/Utils.hs
+0
-2
No files found.
src/Gargantext/API/Node/Corpus/Searx.hs
View file @
baa2491f
...
...
@@ -15,7 +15,6 @@ module Gargantext.API.Node.Corpus.Searx where
import
Control.Lens
(
view
)
import
Data.Aeson
qualified
as
Aeson
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.Text
qualified
as
T
import
Data.Text
qualified
as
Text
import
Data.Time.Calendar
(
Day
,
toGregorian
)
...
...
@@ -27,14 +26,11 @@ import Gargantext.Core.Config.Types (FramesConfig(..))
import
Gargantext.Core.NLP
(
HasNLPServer
,
nlpServerGet
)
import
Gargantext.Core.NodeStory.Types
(
HasNodeStory
)
import
Gargantext.Core.Text.Corpus.Query
qualified
as
Query
import
Gargantext.Core.Text.List
(
buildNgramsLists
)
import
Gargantext.Core.Text.List.Group.WithStem
(
{-StopSize(..),-}
GroupParams
(
..
))
import
Gargantext.Core.Text.Terms
(
TermType
(
..
))
import
Gargantext.Core.Types
(
HasValidationError
)
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
import
Gargantext.Database.Action.Flow
(
addDocumentsToHyperCorpus
)
--, DataText(..))
import
Gargantext.Database.Action.Flow.List
(
flowList_DbRepo
)
import
Gargantext.Database.Action.Flow
(
addDocumentsToHyperCorpus
,
buildSocialList
)
--, DataText(..))
import
Gargantext.Database.Action.User
(
getUserId
)
import
Gargantext.Database.Admin.Types.Hyperdata.Corpus
(
HyperdataCorpus
)
import
Gargantext.Database.Admin.Types.Hyperdata.Document
(
HyperdataDocument
(
..
))
...
...
@@ -42,7 +38,6 @@ import Gargantext.Database.Admin.Types.Node (CorpusId, ListId, NodeType(NodeText
import
Gargantext.Database.Query.Table.Node
(
getOrMkList
,
insertDefaultNodeIfNotExists
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
)
import
Gargantext.Database.Query.Tree.Error
(
HasTreeError
)
import
Gargantext.Database.Query.Tree.Root
(
getOrMkRootWithCorpus
,
MkCorpusUser
(
MkCorpusUserMaster
))
import
Gargantext.Prelude
import
Gargantext.Utils.Jobs.Monad
(
JobHandle
,
MonadJobStatus
(
..
))
import
Network.HTTP.Client
...
...
@@ -147,17 +142,12 @@ insertSearxResponse user cId listId l (Right (SearxResponse { _srs_results })) =
--
_
<-
flowDataText
user
(
DataNew
[
docs'
])
(
Multi
l
)
cId
Nothing
logStatus
let
mCorpus
=
Nothing
::
Maybe
HyperdataCorpus
void
$
addDocumentsToHyperCorpus
server
mCorpus
(
Multi
l
)
cId
docs'
(
_masterUserId
,
_masterRootId
,
masterCorpusId
)
<-
getOrMkRootWithCorpus
MkCorpusUserMaster
mCorpus
let
gp
=
GroupWithPosTag
l
server
HashMap
.
empty
-- gp = case l of
-- FR -> GroupWithPosTag l Spacy HashMap.empty
-- _ -> GroupWithPosTag l CoreNLP HashMap.empty
ngs
<-
buildNgramsLists
user
cId
masterCorpusId
Nothing
gp
_userListId
<-
flowList_DbRepo
listId
ngs
_
<-
buildSocialList
l
user
cId
listId
mCorpus
Nothing
pure
()
-- TODO Make an async task out of this?
triggerSearxSearch
::
(
MonadBase
IO
m
,
HasNodeStory
env
err
m
...
...
src/Gargantext/Database/Action/Flow/Extract.hs
View file @
baa2491f
src/Gargantext/Database/Action/Flow/Utils.hs
View file @
baa2491f
...
...
@@ -68,8 +68,6 @@ insertDocNgrams lId m = do
-- Given language, ngrams type, a list of terms and a
-- HyperdataDocument, return ngrams that are in this text, with counts.
-- This is a pure function (doesn't use corenlp nor PostgreSQL FTS).
...
...
Przemyslaw Kaminski
@cgenie
mentioned in commit
03b33383
·
Jan 30, 2025
mentioned in commit
03b33383
mentioned in commit 03b33383dd67c1821a4edb4628923cf7bd039d90
Toggle commit list
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