[search] fix HyperdataDocument pattern matching

parent 19ab7c5a
Pipeline #1757 passed with stage
in 32 minutes and 22 seconds
...@@ -251,27 +251,45 @@ class ToHyperdataRow a where ...@@ -251,27 +251,45 @@ class ToHyperdataRow a where
toHyperdataRow :: a -> HyperdataRow toHyperdataRow :: a -> HyperdataRow
instance ToHyperdataRow HyperdataDocument where instance ToHyperdataRow HyperdataDocument where
toHyperdataRow (HyperdataDocument b d u ui ub p t a i s abs' pd py pm pda ph pmin psec l) = toHyperdataRow (HyperdataDocument { _hd_bdd = bdd
, _hd_doi = doi
, _hd_url = url'
, _hd_uniqId = uniqId
, _hd_uniqIdBdd = uniqIdBdd
, _hd_page = page
, _hd_title = t
, _hd_authors = authors
, _hd_institutes = institutes
, _hd_source = source
, _hd_abstract = abstract
, _hd_publication_date = pdate
, _hd_publication_year = pyear
, _hd_publication_month = pmonth
, _hd_publication_day = pday
, _hd_publication_hour = phour
, _hd_publication_minute = pminute
, _hd_publication_second = psecond
, _hd_language_iso2 = language }) =
HyperdataRowDocument HyperdataRowDocument
(fromMaybe "" b) { _hr_abstract = fromMaybe "" abstract
(fromMaybe "" d) , _hr_authors = fromMaybe "" authors
(fromMaybe "" u) , _hr_bdd = fromMaybe "" bdd
(fromMaybe "" ui) , _hr_doi = fromMaybe "" doi
(fromMaybe "" ub) , _hr_institutes = fromMaybe "" institutes
(fromMaybe 0 p) , _hr_language_iso2 = fromMaybe "EN" language
(fromMaybe "Title" t) , _hr_page = fromMaybe 0 page
(fromMaybe "" a) , _hr_publication_date = fromMaybe "" pdate
(fromMaybe "" i) , _hr_publication_day = fromMaybe 1 pday
(fromMaybe "" s) , _hr_publication_hour = fromMaybe 1 phour
(fromMaybe "" abs') , _hr_publication_minute = fromMaybe 1 pminute
(fromMaybe "" pd) , _hr_publication_month = fromMaybe 1 pmonth
(fromMaybe 2020 py) , _hr_publication_second = fromMaybe 1 psecond
(fromMaybe 1 pm) , _hr_publication_year = fromMaybe 2020 pyear
(fromMaybe 1 pda) , _hr_source = fromMaybe "" source
(fromMaybe 1 ph) , _hr_title = fromMaybe "Title" t
(fromMaybe 1 pmin) , _hr_url = fromMaybe "" url'
(fromMaybe 1 psec) , _hr_uniqId = fromMaybe "" uniqId
(fromMaybe "EN" l) , _hr_uniqIdBdd = fromMaybe "" uniqIdBdd }
instance ToHyperdataRow HyperdataContact where instance ToHyperdataRow HyperdataContact where
toHyperdataRow (HyperdataContact _ (Just (ContactWho _ fn ln _ _)) ou _ _ _ _ _ ) = toHyperdataRow (HyperdataContact _ (Just (ContactWho _ fn ln _ _)) ou _ _ _ _ _ ) =
......
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