From 4ad5357e15bd5eaa31e1073bb99e4ff2c9c92f47 Mon Sep 17 00:00:00 2001 From: Erik de Vries Date: Tue, 11 Dec 2018 11:02:19 +0100 Subject: [PATCH] elasticizer: Added 900s timeout after every batch of 200000 articles when updating, to allow ES to do some segment merges (and clean up disk space) --- R/elasticizer.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/elasticizer.R b/R/elasticizer.R index 15e782b..594735c 100644 --- a/R/elasticizer.R +++ b/R/elasticizer.R @@ -64,6 +64,9 @@ elasticizer <- function(query, src = T, index = 'maml', es_pwd = .rs.askForPassw if (length(update) > 0){ out <- jsonlite:::flatten(json$hits$hits) update(out, localhost = localhost, ...) + if (batch%%200 == 0) { + Sys.sleep(900) + } } else { out <- bind_rows(out, jsonlite:::flatten(json$hits$hits)) }