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
c2ba2f72
Commit
c2ba2f72
authored
Oct 04, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[search] remove search_title in favor of the (previous) search column
parent
35c457c6
Pipeline
#1922
passed with stage
in 43 minutes and 38 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
11 deletions
+4
-11
schema.sql
devops/postgres/schema.sql
+0
-4
Prelude.hs
src/Gargantext/Database/Admin/Types/Hyperdata/Prelude.hs
+1
-1
Node.hs
src/Gargantext/Database/Admin/Types/Node.hs
+0
-1
Facet.hs
src/Gargantext/Database/Query/Facet.hs
+3
-3
Node.hs
src/Gargantext/Database/Schema/Node.hs
+0
-2
No files found.
devops/postgres/schema.sql
View file @
c2ba2f72
...
@@ -38,10 +38,6 @@ CREATE TABLE public.nodes (
...
@@ -38,10 +38,6 @@ CREATE TABLE public.nodes (
FOREIGN
KEY
(
user_id
)
REFERENCES
public
.
auth_user
(
id
)
ON
DELETE
CASCADE
FOREIGN
KEY
(
user_id
)
REFERENCES
public
.
auth_user
(
id
)
ON
DELETE
CASCADE
);
);
ALTER
TABLE
public
.
nodes
OWNER
TO
gargantua
;
ALTER
TABLE
public
.
nodes
OWNER
TO
gargantua
;
ALTER
TABLE
nodes
ADD
COLUMN
IF
NOT
EXISTS
search_title
tsvector
;
UPDATE
nodes
SET
search_title
=
to_tsvector
(
'english'
,
coalesce
(
"hyperdata"
->>
'title'
,
''
)
||
' '
||
coalesce
(
"hyperdata"
->>
'abstract'
,
''
));
CREATE
INDEX
IF
NOT
EXISTS
search_title_idx
ON
nodes
USING
GIN
(
search_title
);
--------------------------------------------------------------
--------------------------------------------------------------
-- | Ngrams
-- | Ngrams
CREATE
TABLE
public
.
ngrams
(
CREATE
TABLE
public
.
ngrams
(
...
...
src/Gargantext/Database/Admin/Types/Hyperdata/Prelude.hs
View file @
c2ba2f72
...
@@ -48,7 +48,7 @@ import GHC.Generics (Generic)
...
@@ -48,7 +48,7 @@ import GHC.Generics (Generic)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
,
wellNamedSchema
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
,
wellNamedSchema
)
import
Gargantext.Database.Prelude
(
fromField'
)
import
Gargantext.Database.Prelude
(
fromField'
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Opaleye
(
DefaultFromField
(
..
),
PGJsonb
,
defaultFromField
,
fieldQueryRunnerColumn
,
Nullable
)
import
Opaleye
(
DefaultFromField
,
defaultFromField
,
PGJsonb
,
fieldQueryRunnerColumn
,
Nullable
)
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
hiding
(
vector
)
import
Test.QuickCheck.Arbitrary
hiding
(
vector
)
...
...
src/Gargantext/Database/Admin/Types/Node.hs
View file @
c2ba2f72
...
@@ -141,7 +141,6 @@ instance (Arbitrary hyperdata
...
@@ -141,7 +141,6 @@ instance (Arbitrary hyperdata
<*>
arbitrary
<*>
arbitrary
<*>
arbitrary
<*>
arbitrary
<*>
arbitrary
<*>
arbitrary
<*>
arbitrary
------------------------------------------------------------------------
------------------------------------------------------------------------
pgNodeId
::
NodeId
->
O
.
Column
O
.
PGInt4
pgNodeId
::
NodeId
->
O
.
Column
O
.
PGInt4
...
...
src/Gargantext/Database/Query/Facet.hs
View file @
c2ba2f72
...
@@ -329,7 +329,7 @@ runViewDocuments cId t o l order query = do
...
@@ -329,7 +329,7 @@ runViewDocuments cId t o l order query = do
-- WHERE nn.node1_id = ? -- corpusId
-- WHERE nn.node1_id = ? -- corpusId
-- AND n.typename = ? -- NodeTypeId
-- AND n.typename = ? -- NodeTypeId
-- AND nn.category = ? -- isTrash or not
-- AND nn.category = ? -- isTrash or not
-- AND (n.search
_title
@@ to_tsquery(?) OR ? = '') -- query with an OR hack for empty to_tsquery('') results
-- AND (n.search @@ to_tsquery(?) OR ? = '') -- query with an OR hack for empty to_tsquery('') results
-- |]
-- |]
runCountDocuments
::
HasDBid
NodeType
=>
CorpusId
->
IsTrash
->
Maybe
Text
->
Cmd
err
Int
runCountDocuments
::
HasDBid
NodeType
=>
CorpusId
->
IsTrash
->
Maybe
Text
->
Cmd
err
Int
...
@@ -359,8 +359,8 @@ viewDocuments cId t ntId mQuery = proc () -> do
...
@@ -359,8 +359,8 @@ viewDocuments cId t ntId mQuery = proc () -> do
-- restrict -< (n^.node_name) `ilike` (sqlStrictText iLikeQuery)
-- restrict -< (n^.node_name) `ilike` (sqlStrictText iLikeQuery)
restrict
-<
if
query
==
""
restrict
-<
if
query
==
""
then
pgBool
True
then
pgBool
True
--else (n^.ns_search
_title
) @@ (pgTSQuery (T.unpack query))
--else (n^.ns_search) @@ (pgTSQuery (T.unpack query))
else
(
n
^.
ns_search
_title
)
@@
(
toTSQuery
$
T
.
unpack
query
)
else
(
n
^.
ns_search
)
@@
(
toTSQuery
$
T
.
unpack
query
)
returnA
-<
FacetDoc
(
_ns_id
n
)
returnA
-<
FacetDoc
(
_ns_id
n
)
(
_ns_date
n
)
(
_ns_date
n
)
...
...
src/Gargantext/Database/Schema/Node.hs
View file @
c2ba2f72
...
@@ -154,7 +154,6 @@ data NodePolySearch id
...
@@ -154,7 +154,6 @@ data NodePolySearch id
,
_ns_hyperdata
::
hyperdata
,
_ns_hyperdata
::
hyperdata
,
_ns_search
::
search
,
_ns_search
::
search
,
_ns_search_title
::
search
}
deriving
(
Show
,
Generic
)
}
deriving
(
Show
,
Generic
)
$
(
makeAdaptorAndInstance
"pNodeSearch"
''
N
odePolySearch
)
$
(
makeAdaptorAndInstance
"pNodeSearch"
''
N
odePolySearch
)
...
@@ -174,7 +173,6 @@ nodeTableSearch = Table "nodes" ( pNodeSearch
...
@@ -174,7 +173,6 @@ nodeTableSearch = Table "nodes" ( pNodeSearch
,
_ns_hyperdata
=
requiredTableField
"hyperdata"
,
_ns_hyperdata
=
requiredTableField
"hyperdata"
,
_ns_search
=
optionalTableField
"search"
,
_ns_search
=
optionalTableField
"search"
,
_ns_search_title
=
optionalTableField
"search_title"
}
}
)
)
------------------------------------------------------------------------
------------------------------------------------------------------------
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