Commit 93221100 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[search] successful search_title tsquery search

parent ed758424
...@@ -14,18 +14,13 @@ module Gargantext.Database.Action.Search where ...@@ -14,18 +14,13 @@ module Gargantext.Database.Action.Search where
import Control.Arrow (returnA) import Control.Arrow (returnA)
import Control.Lens ((^.)) import Control.Lens ((^.))
import Data.Aeson
import Data.List (intersperse)
import Data.Maybe import Data.Maybe
import Data.String (IsString(..)) import Data.Text (Text, unpack, intercalate)
import Data.Text (Text, words, unpack, intercalate)
import Data.Time (UTCTime) import Data.Time (UTCTime)
import Database.PostgreSQL.Simple (Query)
import Database.PostgreSQL.Simple.ToField
import Gargantext.Core import Gargantext.Core
import Gargantext.Core.Types import Gargantext.Core.Types
import Gargantext.Database.Admin.Types.Hyperdata (HyperdataDocument(..), HyperdataContact(..)) import Gargantext.Database.Admin.Types.Hyperdata (HyperdataDocument(..), HyperdataContact(..))
import Gargantext.Database.Prelude (Cmd, runPGSQuery, runOpaQuery, runCountOpaQuery) import Gargantext.Database.Prelude (Cmd, runOpaQuery, runCountOpaQuery)
import Gargantext.Database.Query.Facet import Gargantext.Database.Query.Facet
import Gargantext.Database.Query.Filter import Gargantext.Database.Query.Filter
import Gargantext.Database.Query.Join (leftJoin5) import Gargantext.Database.Query.Join (leftJoin5)
......
...@@ -61,7 +61,7 @@ import qualified Opaleye.Internal.Unpackspec() ...@@ -61,7 +61,7 @@ import qualified Opaleye.Internal.Unpackspec()
import Gargantext.Core import Gargantext.Core
import Gargantext.Core.Types import Gargantext.Core.Types
import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger, wellNamedSchema) import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger, wellNamedSchema)
import Gargantext.Database.Action.TSQuery (toTSQuery) -- import Gargantext.Database.Action.TSQuery (toTSQuery)
import Gargantext.Database.Admin.Types.Hyperdata import Gargantext.Database.Admin.Types.Hyperdata
import Gargantext.Database.Query.Filter import Gargantext.Database.Query.Filter
import Gargantext.Database.Query.Join (leftJoin5) import Gargantext.Database.Query.Join (leftJoin5)
...@@ -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` (pgStrictText iLikeQuery) -- restrict -< (n^.node_name) `ilike` (pgStrictText 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_title) @@ (pgTSQuery (T.unpack query))
--else (n^.ns_search_title) @@ (toTSQuery [query]) else (n^.ns_search_title) @@ (toTSQuery $ T.unpack query)
returnA -< FacetDoc (_ns_id n) returnA -< FacetDoc (_ns_id n)
(_ns_date n) (_ns_date n)
......
...@@ -43,8 +43,10 @@ extra-deps: ...@@ -43,8 +43,10 @@ extra-deps:
commit: 8cb8aaf2962ad44d319fcea48442e4397b3c49e8 commit: 8cb8aaf2962ad44d319fcea48442e4397b3c49e8
# Databases libs # Databases libs
- git: https://github.com/delanoe/haskell-opaleye.git #- opaleye-0.6.7002.0 #- git: https://github.com/delanoe/haskell-opaleye.git #- opaleye-0.6.7002.0)
commit: 63ee65d974e9d20eaaf17a2e83652175988cbb79 # commit: 63ee65d974e9d20eaaf17a2e83652175988cbb79
- git: https://github.com/cgenie/haskell-opaleye.git
commit: 41e3212e7da83d295cd6d0fa4f0a2b55b86bbbca
- git: https://github.com/delanoe/hsparql.git - git: https://github.com/delanoe/hsparql.git
commit: 308c74b71a1abb0a91546fa57d353131248e3a7f commit: 308c74b71a1abb0a91546fa57d353131248e3a7f
- git: https://github.com/robstewart57/rdf4h.git - git: https://github.com/robstewart57/rdf4h.git
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment