]> git.koha-community.org Git - koha.git/commit
Bug 18068: ES - Fix location and (home|holding)branch facets
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 6 Feb 2017 19:22:51 +0000 (16:22 -0300)
committerKatrin Fischer <katrin.fischer.83@web.de>
Sun, 19 Feb 2017 20:15:07 +0000 (21:15 +0100)
commit41335270815dd88f9678531befef4ee8126baaa1
tree9b1093780eea98f14b099a113872253d27c9fdbe
parentd4bf99e488740201832743bf9e8f5b0e4915902c
Bug 18068: ES - Fix location and (home|holding)branch facets

This patch makes the 'Locations' facet work as expected (i.e. having the
same behaviour it has for Zebra: picking the 952$c in MARC21 and 995e
for UNIMARC).

It also adds the code to handle holding and home library settings for
facets and makes the facets show the library name instead of the branch
code.

The mappings are updated so the labels match what facets.inc expect to
work properly.

To test:
- On master, do a search that returns biblios with items having
homebranch set.
=> FAIL: Under the 'Locations' label on the facets you will notice
branchcodes are shown.
- Apply the patch
- Restart memcached and plack (just in case, it was tricky)
- Reset your mappings:
  http://localhost:8081/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1
- Restart memcached and plack (again, not sure if needed)
- Make sure this mappings are set:
  homebranch => HomeLibrary
  holdingbranch => HoldingLibrary
  (Note: it might not be set due to the place the yaml file is being picked)
- Reindex your records:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ perl misc/search_tools/rebuild_elastic_search.pl -d -v
- Repeat the initial search
=> SUCCESS: 'Location' contains the right stuff, 'Home libraries' and
'Holding libraries' too.
- Run
 k$ prove t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t
=> SUCCESS: Tests pass!
- Sign off :-D

Note: play with the 'DisplayLibraryFacets' syspref options.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d115602c9881371d38f3b1c4bda66e979984b218)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
Koha/SearchEngine/Elasticsearch/Search.pm
admin/searchengine/elasticsearch/mappings.yaml
t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t