From a7732706aa562f19cb9e0782052ba2bce4cdb0c1 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 19 Sep 2019 13:10:23 -0400 Subject: [PATCH] indexer batch size fixes Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib.pm | 7 ++++--- Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib/Search.pm | 3 --- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib.pm b/Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib.pm index 7d05749903..c85811d2c1 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib.pm @@ -25,8 +25,8 @@ use OpenILS::Utils::DateTime qw/interval_to_seconds/; use OpenILS::Elastic; use base qw/OpenILS::Elastic/; -# number of bibs to index per batch. -my $BIB_BATCH_SIZE = 500; +# default number of bibs to index per batch. +my $DEFAULT_BIB_BATCH_SIZE = 500; sub index { my $self = shift; @@ -90,6 +90,7 @@ sub get_bib_ids { my $start_id = $state->{start_record} || 0; my $stop_id = $state->{stop_record}; my $modified_since = $state->{modified_since}; + my $batch_size = $state->{batch_size} || $DEFAULT_BIB_BATCH_SIZE; my ($select, $from, $where); if ($modified_since) { @@ -111,7 +112,7 @@ sub get_bib_ids { # define the batches. my $order = "ORDER BY id"; - my $sql = "$select $from $where $order LIMIT $BIB_BATCH_SIZE"; + my $sql = "$select $from $where $order LIMIT $batch_size"; my $ids = $self->get_db_rows($sql); return [ map {$_->{id}} @$ids ]; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib/Search.pm index 7c7a8ce860..b4dc6c6a0e 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib/Search.pm @@ -30,9 +30,6 @@ use base qw/OpenILS::Elastic::Bib/; my $INDEX_NAME = 'bib-search'; -# number of bibs to index per batch. -my $BIB_BATCH_SIZE = 500; - my $BASE_INDEX_SETTINGS = { analysis => { analyzer => { -- 2.11.0