Koha-clms/t/db_dependent/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
..
Account Bug 23805: Update 'Pay' to 'PAYMENT' for consistency 2019-10-24 17:35:20 +01:00
Acquisition Bug 23927: Add tests 2019-11-27 09:18:27 +00:00
Biblio
…
BiblioUtils
…
Cash Bug 23321: Allow setting of branch default 2019-09-23 11:39:22 +01:00
Charges Bug 25729: Prevent Charges/Fees.t to fail on slow server 2020-07-31 03:12:22 +12:00
Checkouts Bug 24507: Make Checkouts/ReturnClaim.t pass on MySQL 8 2020-02-10 22:28:26 +00:00
Club Bug 24546: Fix intentions of build_sample_item in Club/Hold.t 2020-02-10 23:50:30 +00:00
Config
…
Filter Bug 23793: Unit tests 2019-10-23 17:33:09 +01:00
IssuingRules
…
Item
…
Library
…
Objects/Mixin Bug 23994: Fix random failure from AdditionalFields.t (U18) 2019-11-08 09:31:47 +00:00
Patron Bug 24016: Add a failing test for overwrite-able manager_id in Koha::Patron::Message 2020-01-18 15:04:55 +00:00
Patrons Bug 22025: Add a regression test 2020-04-03 21:11:14 +00:00
Plugins Bug 22706: (RM follow-up) Add unit tests 2019-10-31 12:21:22 +00:00
REST Bug 26322: [19.11.x] Regression tests 2020-09-22 10:15:03 +12:00
SearchEngine Bug 25273: Make match-heading rely on authority type configuration 2020-10-20 13:54:22 +13:00
Subscription
…
Tags
…
Template/Plugin
…
XSLT Bug 24756: [19.11.X] Catch two failed to load-variations in Security.t 2020-04-03 20:04:45 +00:00
Z3950Responder Bug 25277: Unit test 2020-05-19 22:57:37 +00:00
Account.t Bug 24408: Do not compare floats with precision in tests 2020-01-31 23:10:19 +00:00
ActionLogs.t Bug 24329: Add a test 2020-01-18 15:25:27 +00:00
ApiKeys.t
…
Authorities.t
…
Biblio.t Bug 16284: Add Koha::Biblio->is_serial method 2019-08-13 14:36:04 +01:00
BiblioFrameworks.t
…
Biblios.t Bug 22445: Replace %% with {} 2019-10-22 15:02:51 +01:00
Checkouts.t
…
CirculationRules.t
…
Cities.t
…
ClassSortRules.t
…
ClassSources.t
…
ClassSplitRules.t
…
CsvProfiles.t
…
Database.t
…
GetDailyQuote.t
…
Holds.t
…
IssuingRules.t
…
Item.t Bug 25006: Regression tests 2020-04-28 20:29:17 +00:00
ItemTypes.t Bug 24408: Do not compare floats with precision in tests 2020-01-31 23:10:19 +00:00
Items.t Bug 23413: Fix tests 2019-10-25 10:45:36 +01:00
KeyboardShortcuts.t
…
Libraries.t Bug 23821: Remove new occurrence of create_helper_biblio 2019-10-17 14:52:43 +01:00
MarcSubfieldStructures.t
…
News.t
…
Notices.t
…
Object.t Bug 24590: Fix Koha/Object.t on MySQL 8 2020-02-11 00:14:51 +00:00
Objects.t Bug 24147: Don't assume search_related will return ordered values 2020-09-09 22:16:31 +12:00
Patron.t Bug 23634: Add tests for is_superlibrarian 2020-08-25 15:30:10 +12:00
Patrons.t Bug 24114: (follow-up) Resolve warning on non-numeric subtraction 2020-03-30 21:57:35 +00:00
Ratings.t
…
Reports.t
…
Reviews.t
…
SMS_Providers.t
…
SearchField.t Bug 20589: (RM follow-up) Fix Koha::SearchField.t 2019-10-03 14:17:32 +01:00
SharedContent.t Bug 23075: (RM follow-up) Update mock in tests 2019-11-07 07:56:17 +00:00
Subscription.t
…
Suggestions.t
…
Tags.t
…
Z3950Servers.t
…