From a3c3651c796a42b387a47f0b28806f84779f772c Mon Sep 17 00:00:00 2001 From: Erik de Vries Date: Tue, 11 Dec 2018 11:55:14 +0100 Subject: [PATCH] elasticizer: updated scroll time to be longer than the timeouts every 200000 articles (so 20m scroll time, 900s (15m) timeout) --- R/elasticizer.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/elasticizer.R b/R/elasticizer.R index 594735c..9aa7a16 100644 --- a/R/elasticizer.R +++ b/R/elasticizer.R @@ -37,10 +37,10 @@ elasticizer <- function(query, src = T, index = 'maml', es_pwd = .rs.askForPassw } # Get all results - one approach is to use a while loop if (src == T) { - res <- Search(index = index, time_scroll="5m",body = query, size = 1000, raw=T) + res <- Search(index = index, time_scroll="20m",body = query, size = 1000, raw=T) } if (src == F) { - res <- Search(index = index, time_scroll="5m",body = query, size = 1000, raw=T, source = F) + res <- Search(index = index, time_scroll="20m",body = query, size = 1000, raw=T, source = F) } json <- fromJSON(res) if (json$hits$total == 0) { @@ -55,7 +55,7 @@ elasticizer <- function(query, src = T, index = 'maml', es_pwd = .rs.askForPassw update(out, localhost = localhost, ...) } while(hits != 0){ - res <- scroll(json$`_scroll_id`, time_scroll="5m", raw=T) + res <- scroll(json$`_scroll_id`, time_scroll="20m", raw=T) json <- fromJSON(res) hits <- length(json$hits$hits) if(hits > 0) {