LP#1698206: Indicate broad searches and heavy facets
authorMike Rylander <miker@esilibrary.com>
Mon, 10 Jul 2017 14:35:07 +0000 (10:35 -0400)
committerKathy Lussier <klussier@masslnc.org>
Mon, 28 Aug 2017 15:14:53 +0000 (11:14 -0400)
There is a configurable, pagable limit on hits, defined by the superpage
size and max superpages.  When the hit count equals this (by default,
100000) we add a '+' to the hit count to show that there are even more hits.

Facets are calculated per superpage, and if the facet use count equals the
number of superpages seen so far multiplied by the superpage size, we
likewise add '+' to indicate that there are likely more records matching the
facet.

For facets, a user can page far enough to increase the visible number, if
they cross superpage boundaries.

Signed-off-by: Mike Rylander <miker@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>

Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
Open-ILS/src/templates/opac/parts/result/facets.tt2
Open-ILS/src/templates/opac/parts/result/paginate.tt2

index facc53d..4a0336d 100644 (file)
@@ -1293,6 +1293,7 @@ sub staged_search {
             global_summary    => $global_summary,
             count             => $global_summary->{visible},
             core_limit        => $search_hash->{core_limit},
+            superpage         => $page,
             superpage_size    => $search_hash->{check_limit},
             superpage_summary => $current_page_summary,
             facet_key         => $facet_key,
index fa72bc9..6cc9437 100644 (file)
@@ -470,6 +470,9 @@ sub load_rresults {
 
     $ctx->{ids} = $rec_ids;
     $ctx->{hit_count} = $results->{count};
+    $ctx->{superpage} = $results->{superpage};
+    $ctx->{superpage_size} = $results->{superpage_size};
+    $ctx->{pagable_limit} = $results->{core_limit};
     $ctx->{query_struct} = $results->{global_summary}{query_struct};
     $logger->debug('query struct: '. Dumper($ctx->{query_struct}));
     $ctx->{canonicalized_query} = $results->{global_summary}{canonicalized_query};
index c8c7196..38f231f 100644 (file)
@@ -120,7 +120,7 @@ FOR facet IN sorted_facets;
                               href="[% mkurl('', {facet => new_facets}) %]" rel="nofollow" vocab="">[% display_value %]</a>
                             [% END %]
                         </div>
-                        <div class="count">([% facet_data.count %])</div>
+                        <div class="count">([% facet_data.count; IF facet_data.count == (ctx.superpage + 1) * ctx.superpage_size; '+'; END %])</div>
                     </div>
                 [% 
                     ELSE;
index 00e1fb2..ba66454 100644 (file)
@@ -2,6 +2,7 @@
 <div class="results_header_nav1">
     <span class="h1">[% ctx.bookbag ? l('List Contents') : l('Search Results') %]</span>
     <span class="result_number">
+                [%~ IF ctx.hit_count == ctx.pagable_limit; ctx.hit_count = ctx.hit_count _ '+'; END ~%]
                 [%~ |l('<span class="result_count_number">' _ ctx.result_start _'</span>',
                 '<span class="result_count_number">' _ ctx.result_stop _ '</span>',
                 '<span class="result_count_number">' _ ctx.hit_count _ '</span>')  ~%]