[open-ils-commits] r10070 - in branches/rel_1_2/Open-ILS: examples src/perlmods/OpenILS/Application/Search

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jul 18 10:42:49 EDT 2008


Author: erickson
Date: 2008-07-18 10:42:47 -0400 (Fri, 18 Jul 2008)
New Revision: 10070

Modified:
   branches/rel_1_2/Open-ILS/examples/opensrf.xml.example
   branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
Log:
added core limit search setting, summary info in return object, and changed defaults to 500/20

Modified: branches/rel_1_2/Open-ILS/examples/opensrf.xml.example
===================================================================
--- branches/rel_1_2/Open-ILS/examples/opensrf.xml.example	2008-07-18 13:28:59 UTC (rev 10069)
+++ branches/rel_1_2/Open-ILS/examples/opensrf.xml.example	2008-07-18 14:42:47 UTC (rev 10070)
@@ -256,8 +256,8 @@
                     <marc_html_xsl>oilsMARC21slim2HTML.xsl</marc_html_xsl>
                     <!-- Default to using staged search -->
                     <use_staged_search>true</use_staged_search>
-                    <superpage_size>1000</superpage_size>
-                    <max_superpages>25</max_superpages>
+                    <superpage_size>500</superpage_size>
+                    <max_superpages>20</max_superpages>
                     <!-- zip code database file -->
                     <!--<zips_file>/openils/var/data/zips.txt</zips_file>-->
                 </app_settings>

Modified: branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
===================================================================
--- branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm	2008-07-18 13:28:59 UTC (rev 10069)
+++ branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm	2008-07-18 14:42:47 UTC (rev 10070)
@@ -46,10 +46,10 @@
 			"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,8 +713,12 @@
     # 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);
     my $cache_data = $cache->get_cache($key) || {};
@@ -724,6 +728,7 @@
     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 @@
             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 @@
 
     return {
         count => $est_hit_count,
+        core_limit => $search_hash->{core_limit},
+        superpage_size => $search_hash->{check_limit},
+        superpage_summary => $current_page_summary,
         ids => \@results
     };
 }



More information about the open-ils-commits mailing list