WIP: DON'T MERGE YET - Slight lang improvement
Related issue/comment: gargantext/haskell-gargantext#244 (comment 8081)
Hello @cgenie, please could you help please?
Objective of the branch:
- help to get the same results from API requests as the results from the online HAL search (http)
- Currently, title_s is not localized (same for FR /EN), but search results are more accurate if title_s is replaced par *_title_s, just as *_abstract_s has been recently localized (fr_abstract_s, en_abstract_s).
Concrete example, a wanted API request:
- FR: https://api.archives-ouvertes.fr/search/?q=text:(arbitrary%20monadic%20effects)&fl=docid,fr_title_s,fr_abstract_s&wt=json
- EN: https://api.archives-ouvertes.fr/search/?q=text:(arbitrary%20monadic%20effects)&fl=docid,en_title_s,en_abstract_s&wt=json
PLEASE HELP - what I did/tried:
- on this hal repo, I added
langTitleS
with the same behaviour aslangAbstractS
but I get this blocking error on compilation and can't find what to do:
src/HAL/Doc/Corpus.hs:35:37: error:
• Ambiguous type variable ‘a0’ arising from a use of ‘.:’
prevents the constraint ‘(FromJSON a0)’ from being solved.
Probable fix: use a type annotation to specify what ‘a0’ should be.
These potential instances exist:
instance FromJSON DotNetTime
-- Defined in ‘aeson-1.5.6.0:Data.Aeson.Types.FromJSON’
instance FromJSON Value
-- Defined in ‘aeson-1.5.6.0:Data.Aeson.Types.FromJSON’
instance (FromJSON a, FromJSON b) => FromJSON (Either a b)
-- Defined in ‘aeson-1.5.6.0:Data.Aeson.Types.FromJSON’
...plus 51 others
...plus 52 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the first argument of ‘(<|>)’, namely ‘o .: "en_title_s"’
In a stmt of a 'do' block:
_corpus_title <- o .: "en_title_s" <|> return []
In the expression:
do _corpus_docid <- o .: "docid"
_corpus_title <- o .: "en_title_s" <|> return []
_corpus_abstract <- o .: "en_abstract_s" <|> return []
_corpus_date <- o .:? "submittedDate_s"
....
|
35 | _corpus_title <- o .: "en_title_s" <|> return []
| ^^^^^^^^^^^^^^^^^
Error: cabal: Failed to build crawlerHAL-0.1.0.0 (which is required by
exe:gargantext-server from gargantext-0.0.6.9.9.7.5.1). See the build log
above for details.
Thank you in advance