Commit f45d6b92 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] query

parent 9a434702
...@@ -17,13 +17,15 @@ import qualified Data.Text as T ...@@ -17,13 +17,15 @@ import qualified Data.Text as T
yearReq = [text| yearReq = [text|
(language_t:en) (language_t:en)
AND (producedDateY_i:2015 AND (producedDateY_i:2015
OR producedDateY_i:2016 OR producedDateY_i:2016
OR producedDateY_i:2017 OR producedDateY_i:2017
OR producedDateY_i:2018 OR producedDateY_i:2018
OR producedDateY_i:2019
OR producedDateY_i:2020
OR producedDateY_i:2021 OR producedDateY_i:2021
OR producedDateY_i:2022) OR producedDateY_i:2022)
AND (structId_i:302102 AND (structId_i:302102
OR structId_i:469216 OR structId_i:469216
OR structId_i:6279 OR structId_i:6279
...@@ -64,6 +66,7 @@ imt = [ ...@@ -64,6 +66,7 @@ imt = [
main :: IO () main :: IO ()
main = do main = do
-- res <- getMetadataWith (generateRequestByStructID "artificial intelligence" imt) (Just 0) (Just 55)
res <- getMetadataWith (generateRequestByStructID "artificial intelligence" imt) (Just 0) (Just 55) res <- getMetadataWith (generateRequestByStructID "artificial intelligence" imt) (Just 0) (Just 55)
case res of case res of
(Left err) -> print err (Left err) -> print err
......
...@@ -44,7 +44,7 @@ getMetadataWithC q start rows = do ...@@ -44,7 +44,7 @@ getMetadataWithC q start rows = do
rows' = fromMaybe _numFound rows rows' = fromMaybe _numFound rows
numResults = rows' - (fromIntegral start') numResults = rows' - (fromIntegral start')
numPages = numResults `div` (fromIntegral batchSize) + 1 numPages = numResults `div` (fromIntegral batchSize) + 1
getPage :: Text -> Int -> Int -> IO [Corpus] getPage :: Text -> Int -> Int -> IO [Corpus]
getPage q start pageNum = do getPage q start pageNum = do
let offset = start + pageNum * batchSize let offset = start + pageNum * batchSize
......
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