Commit 4aad6c62 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] DocId

parent f45d6b92
...@@ -18,10 +18,7 @@ import qualified Data.Text as T ...@@ -18,10 +18,7 @@ import qualified Data.Text as T
yearReq = [text| yearReq = [text|
(language_t:en) (language_t:en)
AND (producedDateY_i:2015 AND (producedDateY_i:2018
OR producedDateY_i:2016
OR producedDateY_i:2017
OR producedDateY_i:2018
OR producedDateY_i:2019 OR producedDateY_i:2019
OR producedDateY_i:2020 OR producedDateY_i:2020
OR producedDateY_i:2021 OR producedDateY_i:2021
...@@ -71,3 +68,4 @@ main = do ...@@ -71,3 +68,4 @@ main = do
case res of case res of
(Left err) -> print err (Left err) -> print err
(Right val) -> print $ _docs val (Right val) -> print $ _docs val
...@@ -14,7 +14,7 @@ import Servant.API (ToHttpApiData(..)) ...@@ -14,7 +14,7 @@ import Servant.API (ToHttpApiData(..))
data Corpus = Corpus data Corpus = Corpus
{ {
_corpus_docid :: Int, _corpus_docid :: Text,
_corpus_title :: [Text], _corpus_title :: [Text],
_corpus_abstract :: [Text], _corpus_abstract :: [Text],
_corpus_date :: Maybe Text, _corpus_date :: Maybe Text,
...@@ -26,7 +26,7 @@ data Corpus = Corpus ...@@ -26,7 +26,7 @@ data Corpus = Corpus
L.makeLenses ''Corpus L.makeLenses ''Corpus
instance Default Corpus where instance Default Corpus where
def = Corpus def def def def def def def def def = Corpus "" def def def def def def def
instance FromJSON Corpus where instance FromJSON Corpus where
parseJSON (Object o) = Corpus <$> parseJSON (Object o) = Corpus <$>
......
...@@ -11,19 +11,19 @@ import Servant.API (ToHttpApiData(..)) ...@@ -11,19 +11,19 @@ import Servant.API (ToHttpApiData(..))
data EntityTree = EntityTree data EntityTree = EntityTree
{ {
_docid :: Int, _docid :: Text,
_label_s :: Maybe Text, _label_s :: Maybe Text,
_parentEntityTreeid_i :: [Text] _parentEntityTreeid_i :: [Text]
} deriving (Generic) } deriving (Generic)
instance Default EntityTree where instance Default EntityTree where
def = EntityTree def def def def = EntityTree "" def def
instance FromJSON EntityTree where instance FromJSON EntityTree where
parseJSON (Object o) = EntityTree <$> parseJSON (Object o) =
(o .: "docid") EntityTree <$> (o .: "docid")
<*> (o .:? "label_s") <*> (o .:? "label_s")
<*> (o .:? "parentEntityTreeid_i" .!= []) <*> (o .:? "parentEntityTreeid_i" .!= [])
instance ToHttpApiData EntityTree where instance ToHttpApiData EntityTree where
toUrlPiece _ = "docid,label_s,parentEntityTreeid_i" toUrlPiece _ = "docid,label_s,parentEntityTreeid_i"
......
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