Koha-clms/t/Koha
Nick Clemens c2be412ade Bug 25273: Make match-heading rely on authority type configuration
The match-heading field is a special field used only by the linker, not accessible
to staff or patrons via the interface. This field is used to store the constructed
'search form' used for matching bib headings to authority fields.

In bug 24269 I attempted to use the mappings defined in the inferface and also inject the search term.
This did not work as too many subfields were indexed on their own and leading to false matches.
In this bug we remove the mappings for this field, and create it ourselves during
the indexing process. The C4::Headings module is still used to generate the correct form,
however, the mappings are set based on the authority types in the system. This gives the user
the ability to add new typoes, but prevents mapping changes from breaking linker functionality

To test:
 1 - Start form a sample database with ElasticSearch working
 2 - Download via Z39.50 2 authorities, one of which is a narrower heading of the other, e.g.:
    Waterworks
    Waterworks - Costs
 3 - Place a heading for the broader term in a record. e.g. Waterworks
       In 650$a, without the cataloguing authority plugin. We don't want
       the link created now.
       You need syspref BiblioAddsAuthorities => allow
 4 - Make sure linker is set to default
 5 - Attempt to link the records
       misc/link_bibs_to_authorities.pl
 6 - Linking fails
 7 - Apply patch
 8 - refresh index settings (if using a custom file, remove 'match-heading')
       You can reset mappings in the UI or run this:
       misc/search_tools/rebuild_elasticsearch.pl -v -d -r
 9 - Reindex ES
10 - Try to link again
11 - It succeeds!
12 - Run the tests
     prove t/db_dependent/Koha/SearchEngine/Elasticsearch.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Bug 25273: (follow-up)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ce161fda9b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5597b666e4)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-10-20 13:54:22 +13:00
..
Authority Bug 14769: (QA follow-up) Remove global var $cached_indicators 2018-04-12 10:50:36 -03:00
I18N/po/xx_XX/LC_MESSAGES Bug 15395: Allow correct handling of plural translation 2018-11-08 15:55:50 +00:00
Middleware Bug 25950: Remove <client> in X-Forwarded-For from proxy tests 2020-07-31 01:26:38 +12:00
Plugins Bug 23050: (QA follow-up) Add Koha::Plugins::Tab class 2019-11-05 08:13:59 +00:00
REST/Plugin Bug 26143: Regression tests 2020-08-17 09:49:24 +12:00
SearchEngine Bug 25273: Make match-heading rely on authority type configuration 2020-10-20 13:54:22 +13:00
Util Bug 21560: Unit test for Koha::Util::OpenDocument 2019-03-15 12:02:46 +00:00
Config.t Bug 19760: Fix Config.t test 2017-12-22 14:04:52 -03:00
Exceptions.t Bug 23425: (QA follow-up) Keep it generic 2019-09-23 10:41:58 +01:00
I18N.t Bug 15395: Allow correct handling of plural translation 2018-11-08 15:55:50 +00:00
ItemType.t Bug 12748: (QA followup) make new tests pass 2016-04-26 20:20:14 +00:00
RDF.t Bug 18586: Create module to mint RDF subject URIs 2018-08-09 12:11:16 +00:00
Script.t Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
Script_cron.t Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
Z3950responder.t Bug 13937: Fix issues found in QA 2019-10-08 14:39:50 +01:00