]> git.koha-community.org Git - koha.git/commit
Bug 25273: Make match-heading rely on authority type configuration
authorNick Clemens <nick@bywatersolutions.com>
Tue, 28 Apr 2020 12:19:56 +0000 (12:19 +0000)
committerAleisha Amohia <aleishaamohia@hotmail.com>
Tue, 20 Oct 2020 00:54:22 +0000 (13:54 +1300)
commitc2be412adec1e6c142fa55024e2cbc613ef5152e
treef3a1bf21fa89be7172bb177d0787700adf91dcd7
parent856cb2d1b71f04de7ee457d0d001511f0dcb760a
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 ce161fda9b7d47e3cfcbc73ddb877eed627d6313)

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

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
C4/Biblio.pm
Koha/SearchEngine/Elasticsearch.pm
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
admin/searchengine/elasticsearch/mappings.yaml
t/Koha/SearchEngine/Elasticsearch.t [deleted file]
t/db_dependent/Koha/SearchEngine/Elasticsearch.t [new file with mode: 0644]