]> git.koha-community.org Git - koha.git/commit
Bug 14007: Filter search result values to remove OpacHiddenItems values
authorDavid Cook <dcook@prosentient.com.au>
Thu, 24 Oct 2024 01:33:44 +0000 (01:33 +0000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 25 Oct 2024 14:41:39 +0000 (16:41 +0200)
commit474148538f8c52ae1438e8b606fcbb7577a76c9c
treec3f9c28356e6e96a034039f7849ffe87af1d05dc
parent738c641bccd7c65a7a3a22a5a898085a899b08cb
Bug 14007: Filter search result values to remove OpacHiddenItems values

This change filters the values from the OpacHiddenItems syspref
out of their corresponding search results facets.

Note: This does not mean that all values from hidden items are filtered out of facets.
Rather, it just means that facet data that matches OpacHiddenItems is filtered out. This is
an imperfect fix, but it is a practical fix that has been requested by more than one library.

Test plan:
0. Apply the patch and koha-plack --restart kohadev
1. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
2. Add an item with an item type of "Maps"
3. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacHiddenItems
4. Fill in OpacHiddenItems with the following:
itype: ['MP']
5. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
6. Note that "Maps" does not appear in the "Item types" facet
7. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=test
8. Note that "Maps" does appear in the "Item types" facet

9. ***Repeat this test plan using both Elasticsearch and Zebra indexing***

10. prove -v t/Koha/SearchEngine/Search.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Koha/SearchEngine/Elasticsearch/Search.pm
Koha/SearchEngine/Search.pm
Koha/SearchEngine/Zebra/Search.pm
t/Koha/SearchEngine/Search.t