Commit 6a74498b authored by Mael NICOLAS's avatar Mael NICOLAS

[WIP] Implement basic fq

Todo better type this
parent 5df9762f
......@@ -12,7 +12,7 @@ main :: IO ()
main = do
manager' <- newManager tlsManagerSettings
res <- runClientM
(search ["docid"] (asc "docid"))
(search ["docid"] ["docType_s:(THESE OR HDR)"] (asc "docid"))
(mkClientEnv manager' $ BaseUrl Https "api.archives-ouvertes.fr" 443 "")
case res of
(Left err) -> print err
......
......@@ -18,6 +18,9 @@ type HALAPI = Search
type Search = "search"
-- fl determine which fields will be returned it can be a list of fields or *
:> QueryParams "fl" Text
-- TODO: type this monster
-- fq is to filter request
:> QueryParams "fq" Text
-- preatty much clear, (Asc || Desc) + field you want to sort by
:> QueryParam "sort" SortField
:> Get '[JSON] Response
......@@ -56,5 +59,8 @@ instance FromJSON Doc
halAPI :: Proxy HALAPI
halAPI = Proxy
search :: [Text] -> Maybe SortField -> ClientM Response
search :: [Text]
-> [Text]
-> Maybe SortField
-> ClientM Response
search = client halAPI
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