Commit 2fc23339 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[conduit] some fixes to the fetch function name

parent aa1b7e0f
......@@ -26,8 +26,8 @@ getMetadataWith q start rows = do
manager' <- newManager tlsManagerSettings
runHalAPIClient $ search (Just requestedFields) [q] Nothing start rows
getMetadataRecursively :: Text -> Maybe Int -> Maybe Integer -> IO (Either ClientError (Maybe Integer, ConduitT () Corpus IO ()))
getMetadataRecursively q start rows = do
getMetadataWithC :: Text -> Maybe Int -> Maybe Integer -> IO (Either ClientError (Maybe Integer, ConduitT () Corpus IO ()))
getMetadataWithC q start rows = do
manager' <- newManager tlsManagerSettings
-- First, estimate the total number of documents
eRes <- runHalAPIClient $ search (Just requestedFields) [q] Nothing (Just 0) (Just 1)
......@@ -48,7 +48,6 @@ getMetadataRecursively q start rows = do
getPage :: Text -> Int -> Int -> IO [Corpus]
getPage q start pageNum = do
let offset = start + pageNum * batchSize
print $ show offset
eRes <- runHalAPIClient $ search (Just requestedFields) [q] Nothing (Just offset) (Just $ fromIntegral batchSize)
pure $ case eRes of
Left _ -> []
......
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