Koha/t/Koha
Nick Clemens ce161fda9b 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>
2020-08-31 16:10:25 +02:00
..
Authority
I18N/po/xx_XX/LC_MESSAGES
Middleware Bug 25950: Remove <client> in X-Forwarded-For from proxy tests 2020-07-20 12:37:29 +02:00
Plugins
REST/Plugin Bug 26143: Regression tests 2020-08-05 17:36:28 +02:00
SearchEngine Bug 25273: Make match-heading rely on authority type configuration 2020-08-31 16:10:25 +02:00
Util Bug 26127: local_referer should not compare with OPACBaseURL case insensitive 2020-08-18 14:47:44 +02:00
Config.t
Exceptions.t Bug 25423: (follow-up) Fix wrong test 2020-05-08 16:45:52 -03:00
I18N.t
ItemType.t
RDF.t
Script.t Bug 24201: fix failing tests 2020-08-10 09:58:32 +02:00
Script_cron.t Bug 24201: fix failing tests 2020-08-10 09:58:32 +02:00
sleep.pl Bug 25109: Add ->new and ->lock_exec to Koha::Script 2020-04-14 16:56:57 +01:00
wait.pl Bug 25109: Add 'wait' tests 2020-04-14 16:57:01 +01:00
Z3950responder.t