Commit 241037ce authored by Mudada's avatar Mudada

add publication date (only year)

parent 36d378b3
......@@ -16,4 +16,8 @@ runIstexAPIClient cmd = do
basicSearch :: Maybe T.Text -> IO (Either ClientError Documents)
basicSearch rq = do
runIstexAPIClient $ search (Just "author,title,abstract") (Just 5000) rq
runIstexAPIClient $
search
(Just "author,title,abstract,publicationDate")
(Just 5)
rq
......@@ -32,7 +32,8 @@ data Document = Document
_id :: T.Text,
_title :: Maybe T.Text,
_authors :: [Author],
_abstract :: Maybe T.Text
_abstract :: Maybe T.Text,
_publicationDate :: Maybe Int
} deriving (Show, Generic)
L.makeLenses ''Document
......@@ -43,6 +44,8 @@ instance FromJSON Document where
<*> (o .:? "title")
<*> (o .: "author" <|> pure [])
<*> (o .:? "abstract")
<*> do pPubDate <- (o .:? "publicationDate")
return $ (read . T.unpack) <$> pPubDate
data Documents = Documents
{
......
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