From bb0000e3b9ae1ea35ab56c33df7db0a1ec6e6560 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Tue, 16 Oct 2018 19:20:38 +0200 Subject: [PATCH] reduce batch size for index updates to 25 --- app/models/doi.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index caab3979f..e2cbafd86 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -250,7 +250,7 @@ def self.index_by_day(options={}) logger = Logger.new(STDOUT) - Doi.where("created >= ?", from_date.strftime("%F") + " 00:00:00").where("created < ?", until_date.strftime("%F") + " 00:00:00").where("updated > indexed").find_in_batches(batch_size: 50) do |dois| + Doi.where("created >= ?", from_date.strftime("%F") + " 00:00:00").where("created < ?", until_date.strftime("%F") + " 00:00:00").where("updated > indexed").find_in_batches(batch_size: 25) do |dois| response = Doi.__elasticsearch__.client.bulk \ index: Doi.index_name, type: Doi.document_type,