Bugzilla – Attachment 129595 Details for
Bug 29561
Remove blank facet for languages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29561: Remove blank facets
Bug-29561-Remove-blank-facets.patch (text/plain), 1.84 KB, created by
Martin Renvoize (ashimema)
on 2022-01-19 10:32:30 UTC
(
hide
)
Description:
Bug 29561: Remove blank facets
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-01-19 10:32:30 UTC
Size:
1.84 KB
patch
obsolete
>From 9bc5ba9cd1dd6019fe515729920b696dea2d1249 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 23 Nov 2021 14:42:54 +0000 >Subject: [PATCH] Bug 29561: Remove blank facets > >This patch strips the blank facets from the ES aggregations, this seems >to only affect language fields currently, but could affect any facetable field >that can contain blank values > >To test: >1 - Have Koha running Elasticsearch with standard test data, > or add some records with blank values in the 008/35-37 >2 - Search for 'a' >3 - Look at the language facets, they should appear normal >4 - Browse to: > http://localhost:8081/cgi-bin/koha/catalogue/search.pl?idx=&q=a&sort_by=relevance_dsc&count=20&limit=ln: >5 - Note there is now an 'x' under the Languages facet - to remove a limit you cannot see >6 - Apply patch >7 - Reload >8 - Note the x is not there >9 - Inspect HTML, confirm no blank link under language facets > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/SearchEngine/Elasticsearch/Search.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm >index e753220948..85f36c5e53 100644 >--- a/Koha/SearchEngine/Elasticsearch/Search.pm >+++ b/Koha/SearchEngine/Elasticsearch/Search.pm >@@ -483,6 +483,7 @@ sub _convert_facets { > $limit = @{ $data->{buckets} } if ( $limit > @{ $data->{buckets} } ); > foreach my $term ( @{ $data->{buckets} }[ 0 .. $limit - 1 ] ) { > my $t = $term->{key}; >+ next unless $t; # FIXME Currently we cannot search for an empty faceted field i.e. ln:"" to find records missing languages, though ES does count them correctly > my $c = $term->{doc_count}; > my $label; > if ( exists( $special{$type} ) ) { >-- >2.20.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 29561
:
127957
|
128100
|
129595
|
140862
|
140863
|
140864
|
141543
|
141544
|
141545