From: Mike Rylander Date: Mon, 10 Jul 2017 14:35:07 +0000 (-0400) Subject: LP#1698206: Indicate broad searches and heavy facets X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=abdf6f8ebc385996be871594af8985a2fc07b4a2;p=evergreen%2Fmasslnc.git LP#1698206: Indicate broad searches and heavy facets 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 Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm index facc53df01..4a0336d125 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm @@ -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, diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm index fa72bc91eb..6cc94373b8 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm @@ -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}; diff --git a/Open-ILS/src/templates/opac/parts/result/facets.tt2 b/Open-ILS/src/templates/opac/parts/result/facets.tt2 index c8c7196f65..38f231ffc6 100644 --- a/Open-ILS/src/templates/opac/parts/result/facets.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/facets.tt2 @@ -120,7 +120,7 @@ FOR facet IN sorted_facets; href="[% mkurl('', {facet => new_facets}) %]" rel="nofollow" vocab="">[% display_value %] [% END %] -
([% facet_data.count %])
+
([% facet_data.count; IF facet_data.count == (ctx.superpage + 1) * ctx.superpage_size; '+'; END %])
[% ELSE; diff --git a/Open-ILS/src/templates/opac/parts/result/paginate.tt2 b/Open-ILS/src/templates/opac/parts/result/paginate.tt2 index 00e1fb23b2..ba66454335 100644 --- a/Open-ILS/src/templates/opac/parts/result/paginate.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/paginate.tt2 @@ -2,6 +2,7 @@
[% ctx.bookbag ? l('List Contents') : l('Search Results') %] + [%~ IF ctx.hit_count == ctx.pagable_limit; ctx.hit_count = ctx.hit_count _ '+'; END ~%] [%~ |l('' _ ctx.result_start _'', '' _ ctx.result_stop _ '', '' _ ctx.hit_count _ '') ~%]