Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Grégoire Locqueville
purescript-gargantext
Commits
1f8edfc9
Commit
1f8edfc9
authored
Apr 04, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[searchField] implement HAL query with language
parent
8688d3c1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
SearchField.purs
...omponents/Forest/Tree/Node/Action/Search/SearchField.purs
+11
-6
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Search/SearchField.purs
View file @
1f8edfc9
...
...
@@ -16,7 +16,7 @@ import Gargantext.Components.Forest.Tree.Node.Action.Search.Types (DataField(..)
import Gargantext.Components.GraphQL.Endpoints (getIMTSchools)
import Gargantext.Components.GraphQL.IMT as GQLIMT
import Gargantext.Components.InputWithEnter (inputWithEnter)
import Gargantext.Components.Lang (Lang)
import Gargantext.Components.Lang (Lang
(..)
)
import Gargantext.Components.ListSelection as ListSelection
import Gargantext.Components.ListSelection.Types as ListSelection
import Gargantext.Config.REST (logRESTError)
...
...
@@ -560,7 +560,7 @@ searchQuery selection { databases
, datafield = datafield
, lang = lang
, node_id = node_id
, query = queryHAL term Nothing year
, query = queryHAL term Nothing
lang
year
, selection = selection
}) defaultSearchQuery
searchQuery selection { databases
...
...
@@ -573,7 +573,7 @@ searchQuery selection { databases
, datafield = datafield
, lang = lang
, node_id = node_id
, query = queryHAL term (Just imtOrgs) year
, query = queryHAL term (Just imtOrgs)
lang
year
, selection = selection
}) defaultSearchQuery
searchQuery selection { databases, datafield, lang, term, node_id } =
...
...
@@ -585,10 +585,15 @@ searchQuery selection { databases, datafield, lang, term, node_id } =
, selection = selection
}) defaultSearchQuery
queryHAL :: String -> Maybe (Set.Set IMT_org) -> String -> String
queryHAL term mIMTOrgs year =
"(en_title_t:\"" <> termEscaped <> "\" OR en_abstract_t:\"" <> termEscaped <> "\")" <> structQuery <> yearQuery
queryHAL :: String -> Maybe (Set.Set IMT_org) -> Maybe Lang -> String -> String
queryHAL term mIMTOrgs lang year =
"(" <> langPrefix <> "_title_t:\"" <> termEscaped <>
"\" OR " <> langPrefix <> "_abstract_t:\"" <> termEscaped <> "\")" <>
structQuery <> yearQuery
where
langPrefix = case lang of
Just FR -> "fr"
_ -> "en"
-- TODO: Escape double quotes
termEscaped = term
structQuery = case mIMTOrgs of
...
...
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