From abdf6f8ebc385996be871594af8985a2fc07b4a2 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 10 Jul 2017 10:35:07 -0400 Subject: [PATCH] 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 --- Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm | 1 + Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm | 3 +++ Open-ILS/src/templates/opac/parts/result/facets.tt2 | 2 +- Open-ILS/src/templates/opac/parts/result/paginate.tt2 | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) 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 _ '') ~%] -- 2.11.0