From 87abd7523b4c756c991292ecec69fffc23105291 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 18 Jul 2008 14:42:47 +0000 Subject: [PATCH] added core limit search setting, summary info in return object, and changed defaults to 500/20 git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@10070 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/examples/opensrf.xml.example | 4 ++-- .../src/perlmods/OpenILS/Application/Search/Biblio.pm | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Open-ILS/examples/opensrf.xml.example b/Open-ILS/examples/opensrf.xml.example index fcf89f603d..ed1c585337 100644 --- a/Open-ILS/examples/opensrf.xml.example +++ b/Open-ILS/examples/opensrf.xml.example @@ -256,8 +256,8 @@ Example opensrf config file for OpenILS oilsMARC21slim2HTML.xsl true - 1000 - 25 + 500 + 20 diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm index 1cf183c1e4..6dd4671ee8 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm @@ -46,10 +46,10 @@ sub initialize { "apps", "open-ils.search", "app_settings", "cache_timeout" ) || 300; $superpage_size = $sclient->config_value( - "apps", "open-ils.search", "app_settings", "superpage_size" ) || 1000; + "apps", "open-ils.search", "app_settings", "superpage_size" ) || 500; $max_superpages = $sclient->config_value( - "apps", "open-ils.search", "app_settings", "max_superpages" ) || 25; + "apps", "open-ils.search", "app_settings", "max_superpages" ) || 20; $logger->info("Search cache timeout is $cache_timeout, ". " superpage_size is $superpage_size, max_superpages is $max_superpages"); @@ -713,7 +713,11 @@ sub staged_search { # limit and offset should coincide with superpage boundaries $search_hash->{offset} = 0; $search_hash->{limit} = $superpage_size; - $search_hash->{check_limit} = $superpage_size; # force a well-known check_limit + + # force a well-known check_limit + $search_hash->{check_limit} = $superpage_size; + # restrict total tested to superpage size * number of superpages + $search_hash->{core_limit} = $superpage_size * $max_superpages; # pull any existing results from the cache my $key = search_cache_key($method, $search_hash); @@ -724,6 +728,7 @@ sub staged_search { my $all_results = []; my $page; # current superpage my $est_hit_count = 0; + my $current_page_summary = {}; for($page = 0; $page < $max_superpages; $page++) { @@ -759,6 +764,8 @@ sub staged_search { cache_staged_search_page($key, $page, $summary, $results) if $docache; } + $current_page_summary = $summary; + # add the new set of results to the set under construction push(@$all_results, @$results); @@ -785,6 +792,9 @@ sub staged_search { return { count => $est_hit_count, + core_limit => $search_hash->{core_limit}, + superpage_size => $search_hash->{check_limit}, + superpage_summary => $current_page_summary, ids => \@results }; } -- 2.11.0