From: miker Date: Wed, 13 Apr 2011 16:13:14 +0000 (+0000) Subject: Protect search against all-deleted bibs by pinning the estimation ratios in that... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a8621fc3b77f6831f232c9ab39fbb89bba62808c;p=evergreen%2Fjoelewis.git Protect search against all-deleted bibs by pinning the estimation ratios in that case git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@20067 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm index 04960437c1..0c09ed686e 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm @@ -2657,10 +2657,10 @@ sub FTS_paging_estimate { my $delete_adjusted_total = $total - ( $total * $deleted_ratio ); my $exclusion_ratio = $excluded / $checked; - my $delete_adjusted_exclusion_ratio = $excluded / ($checked - $deleted); + my $delete_adjusted_exclusion_ratio = $checked - $deleted ? $excluded / ($checked - $deleted) : 1; my $inclusion_ratio = $visible / $checked; - my $delete_adjusted_inclusion_ratio = $visible / ($checked - $deleted); + my $delete_adjusted_inclusion_ratio = $checked - $deleted ? $visible / ($checked - $deleted) : 0; return { exclusion => int($delete_adjusted_total - ( $delete_adjusted_total * $exclusion_ratio )),