Koha/Koha
Frank Hansen 8c7230b802
Bug 30280: Add support for subject headings from different thesaurus when using Elasticsearch
This patch allows subject headings from different thesaurus to co-exist in Koha.

Test plan:
1. Enable Elasticsearch as the search engine (SearchEngine system preference =
Elasticsearch) and reindex (koha-elasticsearch --rebuild -d -b -a kohadev).
2. Load sample authority records attached to the bug (in this case the
authorities.mrc file was saved in the koha directory - adjust file location as
appropriate):
   misc/migration_tools/bulkmarcimport.pl -v -a -file authorities.mrc -insert
-c=MARC21
3. Load the sample bibliographic record attached to the bug:
   misc/migration_tools/bulkmarcimport.pl -v -b -file biblios.mrc -insert
-c=MARC21
4. Search for ISBN 0704328623 and verify that the subject terms are not linked
to any authority records (if you hover over the link terms, all links should
look like ../cgi-bin/koha/catalogue/search.pl?q=su:"subjectterm" - none should
have any ?q=an:XXX (where XXX = authority record ids) in the link).
5. Apply the patches.
6. Reset the Elasticsearch mappings (Administration > Catalog > Search engine
configuration (Elasticsearch)).
7. Reindex: koha-elasticsearch --rebuild -d -b -a kohadev
8. Link bibliographic records to authority records:
misc/link_bibs_to_authorities.pl -v -l
9. Repeat the search in step 4 (or refresh the record details page) and verify
that the first three Feminism headings[1] are linked to an authority record
(should have ?q=an:XXX (where XXX = different authority record IDs for the
various feminism authority records linked to a specific thesaurus)).
10. Reindex: koha-elasticsearch --rebuild -d -b -a kohadev

[1] Links for subject terms for step 9 in order are (the authority ids may be
different depending on how ou are testing):

    Subject(s:) Feminism | feminism | Feminism | Feminism | Idéhistoria |
Litteratur

    http://127.0.0.1:8081/cgi-bin/koha/catalogue/search.pl?q=an:1709
    http://127.0.0.1:8081/cgi-bin/koha/catalogue/search.pl?q=an:1710
    http://127.0.0.1:8081/cgi-bin/koha/catalogue/search.pl?q=an:1708
    http://127.0.0.1:8081/cgi-bin/koha/catalogue/search.pl?q=su:"Feminism"
    http://127.0.0.1:8081/cgi-bin/koha/catalogue/search.pl?q=su:"Idéhistoria"
    http://127.0.0.1:8081/cgi-bin/koha/catalogue/search.pl?q=su:"Litteratur"

    MARC info:

    650 #7 - SUBJECT ADDED ENTRY--TOPICAL TERM
      a Topical term or geographic name entry element Feminism
      0 Authority record control number or standard number
https://id.kb.se/term/sao/Feminism
      2 Source of heading or term sao
    650 #7 - SUBJECT ADDED ENTRY--TOPICAL TERM
      a Topical term or geographic name entry element feminism
      2 Source of heading or term bnb
    650 #0 - SUBJECT ADDED ENTRY--TOPICAL TERM
      a Topical term or geographic name entry element Feminism
    650 #4 - SUBJECT ADDED ENTRY--TOPICAL TERM
      a Topical term or geographic name entry element Feminism
    650 #4 - SUBJECT ADDED ENTRY--TOPICAL TERM
      a Topical term or geographic name entry element Idéhistoria
    650 #4 - SUBJECT ADDED ENTRY--TOPICAL TERM
      a Topical term or geographic name entry element Litteratur

   Note: The fourth Feminism term has second indicator 4 which means "Source
not specified". So this term is only a local term and does not belong to any
specific thesaurus and thus not linked. To specify a source of a term, the
second indicator must be set as 7. The source of heading is then specified in
subfield 2.

Sponsored-by: Lund University Library, Sweden

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-03 10:00:04 -03:00
..
Account Bug 31254: Add additional fields for accountlines 2022-09-21 18:58:28 -03:00
Acquisition Bug 15348: (follow-up) Fix filtering results on estimated delivery date 2022-09-16 10:36:57 -03:00
App Bug 29498: Remove usage of deprecated Mojolicious::Routes::Route::detour 2022-01-18 21:15:04 -10:00
ArticleRequest
Auth Bug 31389: Calculate user permissions in separate function 2022-09-22 08:39:21 -03:00
Authority
BackgroundJob Bug 27421: MARC staging/import are long-running tasks 2022-09-19 15:33:56 -03:00
Biblio Bug 29697: Fix t/db_dependent/Exporter/Record.t 2022-07-25 09:30:35 -03:00
BiblioUtils Bug 29697: Use flag embed_items 2022-07-22 15:24:11 -03:00
Cache Bug 29623: (QA follow-up) Add POD to Koha::Cache::Lite 2022-06-14 08:26:59 -03:00
Cash Bug 27779: Group payouts by type of debit they're applied against 2022-08-08 13:37:25 -03:00
Charges
Checkouts Bug 28854: Improve lost details display for bundle items 2022-07-13 10:35:36 -03:00
Club Bug 29562: Adjust CanItemBeReserved and checkHighHolds to take objects 2022-01-31 21:55:39 -10:00
CodeList/Unimarc Bug 30941: (QA follow-up) Only export what is needed 2022-08-19 11:00:42 -03:00
Config
Course
Database Bug 21978: Add support for middle name 2022-06-24 12:24:11 -03:00
Edifact Bug 30135: Add EdifactLSQ mapping preference 2022-04-13 15:55:39 +02:00
Exceptions Bug 30650: Prevent pickup to be created on holiday 2022-07-29 15:00:51 -03:00
Exporter Bug 29697: Fix t/db_dependent/Exporter/Record.t 2022-07-25 09:30:35 -03:00
ExternalContent Bug 29686: Adapt Koha to use new fulfillment API for OverDrive 2022-01-28 11:09:06 -10:00
Filter/MARC Bug 15187: Index 880 in Zebra the same as Elasticsearch 2022-07-22 15:09:46 -03:00
Hold Bug 22456: Add Koha::Hold::CancellationRequest(s) class(es) 2022-07-29 15:28:20 -03:00
Illrequest Bug 30484: Implement support for ILL request updates 2022-09-23 09:18:45 -03:00
Import Bug 30779: Remove _update_import_record_marc and update tests 2022-08-18 09:02:04 -03:00
Indexer
Item Bug 31183: Add Koha::Item::Transfers->filter_by_current 2022-08-09 08:26:24 -03:00
Library Bug 29922: Make get_search_groups return results sorted by title 2022-07-18 15:11:35 -03:00
List
MetadataRecord
Middleware Bug 28955: Add OPAC_BRANCH_DEFAULT 2022-02-24 14:35:36 -10:00
Misc
Notice
Number
OAI/Server Bug 30921: (QA follow-up) Remove unnecessary if 2022-09-12 16:26:35 -03:00
Object
Objects Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Old Bug 30612: Rename other occurrences 2022-08-01 09:59:05 -03:00
Patron Bug 23681: Move to ::Patron::Restriction::Type(s) 2022-08-25 08:50:35 -03:00
Patrons Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
pdfformat
Plugins
RecordProcessor
REST Bug 30982: (QA follow-up) Spelling 2022-09-23 08:57:50 -03:00
Result Bug 29746: (it-doesn't-hurt follow-up) More tests 2022-01-05 13:33:46 -10:00
Schema Bug 30571: DBIC schema 2022-10-03 08:30:37 -03:00
SearchEngine Bug 30280: Add support for subject headings from different thesaurus when using Elasticsearch 2022-10-03 10:00:04 -03:00
Serial
Sitemapper
SMS
SMTP Bug 28416: Delay load of Email::Sender::Transport::SMTP 2022-03-25 11:01:04 -10:00
Subscription
SuggestionEngine Bug 31069: Remove ExplodedTerms dependency on templates 2022-07-18 12:37:35 -03:00
Tags
Template/Plugin Bug 31401: (QA follow-up) Remove Koha.ArePluginsEnabled, it is no longer needed 2022-09-07 13:55:37 -07:00
UI Bug 31154: (QA follow-up) Fix UI form builder 2022-09-16 10:26:26 -03:00
Util Bug 30678: (follow-up) Add oclc_number routine and friends 2022-07-22 14:58:11 -03:00
XSLT
Z3950Responder Bug 24295: Remove GetTransfer from Z3950Responder 2022-08-26 15:42:07 -03:00
Account.pm Bug 30458: Include librarian (manager_id) in accountline when using "Payout amount" button 2022-07-21 16:01:08 -03:00
ActionLog.pm
ActionLogs.pm
AdditionalContent.pm
AdditionalContents.pm Bug 29144: Add $contents->find_best_match, $library->opac_info 2022-09-16 09:55:19 -03:00
AdditionalField.pm
AdditionalFields.pm
AdditionalFieldValue.pm
AdditionalFieldValues.pm
AdvancedEditorMacro.pm
AdvancedEditorMacros.pm
ApiKey.pm
ApiKeys.pm
ArticleRequest.pm Bug 29759: Make cancelling an AR refund 2022-01-31 21:55:39 -10:00
ArticleRequests.pm
AudioAlert.pm
AudioAlerts.pm Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
AuthorisedValue.pm
AuthorisedValueCategories.pm
AuthorisedValueCategory.pm
AuthorisedValues.pm Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Authorities.pm
Authority.pm Bug 29897: Remove 'linkage' leftover 2022-08-09 10:58:48 -03:00
AuthUtils.pm Bug 29744: (QA follow-up) Call psgi_env in OO style 2022-09-22 08:11:58 -03:00
BackgroundJob.pm Bug 30982: (QA follow-up) Spelling 2022-09-23 08:57:50 -03:00
BackgroundJobs.pm Bug 30982: (QA follow-up) No userenv, no jobs 2022-09-23 08:57:51 -03:00
Biblio.pm Bug 29897: Add and fix POD 2022-08-09 10:58:45 -03:00
BiblioFramework.pm
BiblioFrameworks.pm
Biblioitem.pm
Biblioitems.pm
Biblios.pm
BiblioUtils.pm Bug 29697: Don't crash ES reindex if a record is wrong 2022-07-22 15:24:12 -03:00
Cache.pm
Caches.pm
Calendar.pm
Checkout.pm Bug 30612: Rename other occurrences 2022-08-01 09:59:05 -03:00
Checkouts.pm
CirculationRule.pm
CirculationRules.pm Bug 22456: Add waiting_hold_cancellation circulation rule 2022-07-29 15:28:13 -03:00
Cities.pm
City.pm
ClassSortRule.pm
ClassSortRules.pm
ClassSource.pm
ClassSources.pm
ClassSplitRule.pm
ClassSplitRules.pm
Club.pm Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Clubs.pm Bug 29844: Simplify Koha::Clubs->get_enrollable 2022-02-09 15:36:23 -10:00
Config.pm
CookieManager.pm Bug 31250: (QA follow-up) The future will be easier 2022-09-12 15:34:11 -03:00
Course.pm
Courses.pm
CoverImage.pm
CoverImages.pm
CsvProfile.pm
CsvProfiles.pm
CurbsidePickup.pm Bug 30650: (QA follow-up) Some higher-level methods usage 2022-07-29 15:38:51 -03:00
CurbsidePickupIssue.pm Bug 30650: Add some useful modules and tests 2022-07-29 14:59:57 -03:00
CurbsidePickupIssues.pm Bug 30650: Add some useful modules and tests 2022-07-29 14:59:57 -03:00
CurbsidePickupOpeningSlot.pm Bug 30650: Add some useful modules and tests 2022-07-29 14:59:57 -03:00
CurbsidePickupOpeningSlots.pm Bug 30650: Add some useful modules and tests 2022-07-29 14:59:57 -03:00
CurbsidePickupPolicies.pm Bug 30650: Add some useful modules and tests 2022-07-29 14:59:57 -03:00
CurbsidePickupPolicy.pm Bug 30650: Allow to restrict curbside pickup for waiting holds only 2022-07-29 15:00:31 -03:00
CurbsidePickups.pm Bug 30650: Add filter_by_scheduled_today 2022-07-29 15:00:47 -03:00
Database.pm
DateUtils.pm Bug 30717: (QA follow-up) Move to module 2022-05-13 15:41:55 -10:00
Desk.pm
Desks.pm
EDI.pm Bug 31054: Manual importing for EDIFACT invoices fails with a 500 error page 2022-07-11 18:23:12 -03:00
Edifact.pm
Email.pm Bug 29330: Add Koha::Email->new_from_string 2021-11-15 12:38:39 +01:00
Encryption.pm Bug 31053: Add Context module to Koha::Encryption 2022-06-27 11:46:22 -03:00
Exception.pm Bug 29857: (QA follow-up) Add license 2022-03-01 22:47:47 -10:00
Exceptions.pm Bug 23681: Move to ::Patron::Restriction::Type(s) 2022-08-25 08:50:35 -03:00
ExternalContent.pm
FrameworkPlugin.pm
Hold.pm Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
Holds.pm Bug 31183: Use filter_by_current in Koha::Holds->get_items_that_can_fill 2022-08-09 08:26:25 -03:00
I18N.pm Bug 30941: Add cataloguing plugins for 146$bcdef (UNIMARC) 2022-08-19 08:55:09 -03:00
Illcomment.pm
Illcomments.pm
Illrequest.pm Bug 30484: Implement support for ILL request updates 2022-09-23 09:18:45 -03:00
Illrequestattribute.pm
Illrequestattributes.pm
Illrequests.pm
ImportBatch.pm
ImportBatches.pm
ImportBatchProfile.pm
ImportBatchProfiles.pm
Item.pm Bug 31441: Fix Koha::Item::as_marc_field when kohafield = '' 2022-10-03 08:40:01 -03:00
Items.pm Bug 31105: Holds to pull counts items from other branches when independentbranches is active 2022-09-23 09:44:18 -03:00
ItemType.pm Bug 29844: Some more uncaught cases 2022-02-09 15:36:23 -10:00
ItemTypes.pm
KeyboardShortcut.pm
KeyboardShortcuts.pm
Libraries.pm
Library.pm Bug 29144: Add $contents->find_best_match, $library->opac_info 2022-09-16 09:55:19 -03:00
Linktracker.pm
Localization.pm
Localizations.pm
Logger.pm Bug 31468: Change interface in Koha::Logger 2022-09-23 09:33:53 -03:00
Manual.pm
MarcOverlayRule.pm
MarcOverlayRules.pm
MarcSubfieldStructure.pm
MarcSubfieldStructures.pm
MessageAttribute.pm
MessageAttributes.pm
MetadataIterator.pm
MetadataRecord.pm Bug 30813: (follow-up) Correct C4::Breeding call 2022-06-08 11:40:31 -03:00
MetaSearcher.pm Bug 30813: (QA follow-up) Adjust three use statements 2022-06-08 11:40:32 -03:00
MoreUtils.pm
OAuth.pm
OAuthAccessToken.pm
OAuthAccessTokens.pm
Object.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Objects.pm Bug 29844: Remove use of wantarray from Koha::Objects 2022-02-09 15:36:23 -10:00
Patron.pm Bug 23538: Email library when new patron self-registers 2022-09-23 09:37:54 -03:00
Patrons.pm Bug 30058: Add Koha::Patrons->filter_by_have_subpermission 2022-03-17 11:22:56 -10:00
Plugins.pm Bug 30180: (follow-up) Add temporary deprecation warning 2022-05-04 14:29:24 -10:00
ProblemReport.pm
ProblemReports.pm
PseudonymizedTransaction.pm
PseudonymizedTransactions.pm
Quote.pm
Quotes.pm
Rating.pm
Ratings.pm
RDF.pm
Recall.pm Bug 30823: Filling recalls uses 'FILL' action in action logs 2022-07-01 16:09:13 -03:00
Recalls.pm Bug 7021: Catch new introductions of UpdateStats 2022-09-22 09:31:28 -03:00
RecordProcessor.pm
Report.pm Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
Reports.pm
Review.pm
Reviews.pm
Schema.pm
Script.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
SearchEngine.pm
SearchField.pm
SearchFields.pm
SearchMarcMap.pm
SearchMarcMaps.pm
Serial.pm
Serials.pm
SharedContent.pm
SimpleMARC.pm Bug 23873: Enable capture groups in MarcModificationTemplates 2022-02-21 15:15:47 -10:00
Sitemapper.pm
Statistic.pm
Statistics.pm
StockRotationItem.pm Bug 30518: Correct DateTime maths for needs_advancing 2022-04-19 21:25:50 -10:00
StockRotationItems.pm
StockRotationRota.pm
StockRotationRotas.pm
StockRotationStage.pm
StockRotationStages.pm
Subscription.pm
Subscriptions.pm
Suggestion.pm Bug 31374: (follow-up) change private note to staff_note and reorder columns 2022-09-07 13:32:51 -07:00
SuggestionEngine.pm
Suggestions.pm Bug 30663: Add Koha::Suggestions helper methods 2022-05-05 10:26:41 -03:00
Tag.pm
Tags.pm
Token.pm Bug 27849: (follow-up) Add test 2022-08-01 09:53:35 -03:00
TrackedLink.pm
TrackedLinks.pm
UploadedFile.pm Bug 29156: File missing warning in Koha::UploadedFile for permanent files only 2022-01-21 21:34:51 -10:00
UploadedFiles.pm
Uploader.pm Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Virtualshelf.pm Bug 29955: Fix method import issues 2022-08-22 13:06:18 -03:00
Virtualshelfcontent.pm
Virtualshelfcontents.pm
Virtualshelfshare.pm Bug 25498: (QA follow-up) Rename virtualshelfshare->patron 2022-07-19 11:25:26 -03:00
Virtualshelfshares.pm
Virtualshelves.pm Bug 31288: (QA follow-up) Check userenv in disown_or_delete 2022-08-03 11:44:07 -03:00
Z3950Responder.pm
Z3950Server.pm
Z3950Servers.pm