From 1d2b1dff3a26a018ae106492166c0048922b3997 Mon Sep 17 00:00:00 2001 From: Janusz Kaczmarek Date: Tue, 2 Jul 2024 12:38:14 +0000 Subject: [PATCH] Bug 37231: (Bug 34940 follow-up) Highlight logged-in library in facets does not work with ES The highlight logged-in library in facets feature does not work with Elasticsearch. This is because facet_title_value contains an additional " (count)" information and so gives negative results in comparisons made in facets.inc (line 107). Test plan: ========== 1. Have a test installation with Elastiscsearch. 2. Set system preference 'DisplayLibraryFacets' to 'both home and holding libraries' 3. Perform a seach that will find items of your logged-in library. In KTD, search for 'branch:CPL' 4. Check the facet (home and holding libraries) of your logged-in library is not highlighted 5. Apply the patch ; restart_all. 6. Repeat p. 3. Check the facet (home and holding libraries)--you should see your logged-in branch highlighted now. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny Signed-off-by: Katrin Fischer --- Koha/SearchEngine/Elasticsearch/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index f4a316345a..42326e3573 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -497,7 +497,7 @@ sub _convert_facets { push @{ $facet->{facets} }, { facet_count => $c, facet_link_value => $t, - facet_title_value => $t . " ($c)", + facet_title_value => $t, facet_label_value => $label, # TODO either truncate this, # or make the template do it like it should anyway type_link_value => $type, -- 2.39.5