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
153
Issues
153
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
ac77596e
Commit
ac77596e
authored
Oct 04, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-ilike-search-fix' into dev-corpora-from-write-nodes
parents
2ba1b298
c2ba2f72
Pipeline
#1925
canceled with stage
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 @
ac77596e
...
...
@@ -38,10 +38,6 @@ CREATE TABLE public.nodes (
FOREIGN
KEY
(
user_id
)
REFERENCES
public
.
auth_user
(
id
)
ON
DELETE
CASCADE
);
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
CREATE
TABLE
public
.
ngrams
(
...
...
src/Gargantext/Database/Admin/Types/Hyperdata/Prelude.hs
View file @
ac77596e
...
...
@@ -48,7 +48,7 @@ import GHC.Generics (Generic)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
,
wellNamedSchema
)
import
Gargantext.Database.Prelude
(
fromField'
)
import
Gargantext.Prelude
import
Opaleye
(
DefaultFromField
(
..
),
PGJsonb
,
defaultFromField
,
fieldQueryRunnerColumn
,
Nullable
)
import
Opaleye
(
DefaultFromField
,
defaultFromField
,
PGJsonb
,
fieldQueryRunnerColumn
,
Nullable
)
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
hiding
(
vector
)
...
...
src/Gargantext/Database/Admin/Types/Node.hs
View file @
ac77596e
...
...
@@ -141,7 +141,6 @@ instance (Arbitrary hyperdata
<*>
arbitrary
<*>
arbitrary
<*>
arbitrary
<*>
arbitrary
------------------------------------------------------------------------
pgNodeId
::
NodeId
->
O
.
Column
O
.
PGInt4
...
...
src/Gargantext/Database/Query/Facet.hs
View file @
ac77596e
...
...
@@ -329,7 +329,7 @@ runViewDocuments cId t o l order query = do
-- WHERE nn.node1_id = ? -- corpusId
-- AND n.typename = ? -- NodeTypeId
-- 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
...
...
@@ -359,8 +359,8 @@ viewDocuments cId t ntId mQuery = proc () -> do
-- restrict -< (n^.node_name) `ilike` (sqlStrictText iLikeQuery)
restrict
-<
if
query
==
""
then
pgBool
True
--else (n^.ns_search
_title
) @@ (pgTSQuery (T.unpack query))
else
(
n
^.
ns_search
_title
)
@@
(
toTSQuery
$
T
.
unpack
query
)
--else (n^.ns_search) @@ (pgTSQuery (T.unpack query))
else
(
n
^.
ns_search
)
@@
(
toTSQuery
$
T
.
unpack
query
)
returnA
-<
FacetDoc
(
_ns_id
n
)
(
_ns_date
n
)
...
...
src/Gargantext/Database/Schema/Node.hs
View file @
ac77596e
...
...
@@ -154,7 +154,6 @@ data NodePolySearch id
,
_ns_hyperdata
::
hyperdata
,
_ns_search
::
search
,
_ns_search_title
::
search
}
deriving
(
Show
,
Generic
)
$
(
makeAdaptorAndInstance
"pNodeSearch"
''
N
odePolySearch
)
...
...
@@ -174,7 +173,6 @@ nodeTableSearch = Table "nodes" ( pNodeSearch
,
_ns_hyperdata
=
requiredTableField
"hyperdata"
,
_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