Bugzilla – Attachment 32554 Details for
Bug 13088
Allow the user to specify a max amount of facets to show.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13088: Allow the user to specify a max amount of facets to show
Bug-13088-Allow-the-user-to-specify-a-max-amount-o.patch (text/plain), 1.71 KB, created by
Tomás Cohen Arazi (tcohen)
on 2014-10-21 14:07:11 UTC
(
hide
)
Description:
Bug 13088: Allow the user to specify a max amount of facets to show
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2014-10-21 14:07:11 UTC
Size:
1.71 KB
patch
obsolete
>From a758b44a6eb822a864d00a130ffa7a1fe436a638 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Mon, 20 Oct 2014 12:12:00 -0300 >Subject: [PATCH] Bug 13088: Allow the user to specify a max amount of facets > to show > >This patch makes _get_facet_from_result_set rely on a new syspref (FacetsMaxCount) >to set the max facets to show for each facet category. It defaults to 20 if >the syspref is absent or empty. > >To test: >- Have a search with lots of facet results (with some category showing the "See more" link). >- Jump to "See more", notice it shows more than 20 facet values. >- Apply the patch, reload the page. >=> SUCCESS It only shows 20 (default hardcoded value) >- Change the FacetsMaxCount syspref to other value (e.g. 15 or 100). >- Reload >=> SUCCESS: it shows the expected amount. >- Sign off :-D > >Regards > >Sponsored-by: Universidad Nacional de Cordoba >--- > C4/Search.pm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index ed9538f..b7dbeb3 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -788,11 +788,12 @@ sub _get_facet_from_result_set { > my $rs = shift; > my $sep = shift; > >- my $internal_sep = '<*>'; >+ my $internal_sep = '<*>'; >+ my $facetMaxCount = C4::Context->preference('FacetMaxCount') // 20; > > return if ( ! defined $facet_idx || ! defined $rs ); > # zebra's facet element, untokenized index >- my $facet_element = 'zebra::facet::' . $facet_idx . ':0:100'; >+ my $facet_element = 'zebra::facet::' . $facet_idx . ':0:' . $facetMaxCount; > # configure zebra results for retrieving the desired facet > $rs->option( elementSetName => $facet_element ); > # get the facet record from result set >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13088
:
32553
|
32554
|
32667
|
32668
|
32738
|
32739
|
32844