Bug 41141 - Linker with Elasticsearch fails when heading contains parenthesis or equal sign
Summary: Linker with Elasticsearch fails when heading contains parenthesis or equal sign
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Authority data support (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-30 12:19 UTC by Fridolin Somers
Modified: 2025-11-02 23:58 UTC (History)
1 user (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Crowdfunding goal: 0
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41141: Fix linker with Elasticsearch fails when heading contains parenthesis or equal sign (2.24 KB, patch)
2025-10-30 16:06 UTC, Fridolin Somers
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2025-10-30 12:19:10 UTC
With Elasticsearch, authorities linker fails when heading contains parenthesis or equal sign.
Looks like those characters are removed because of CCL syntax but Elasticsearch in this context uses 'ci_raw' form that does not matches if characters are removed.
So we should do it only with Zebra.
Comment 1 Fridolin Somers 2025-10-30 16:06:22 UTC
Created attachment 188667 [details] [review]
Bug 41141: Fix linker with Elasticsearch fails when heading contains parenthesis or equal sign

With Elasticsearch, authorities linker fails when heading contains parenthesis or equal sign.
Looks like those characters are removed because of CCL syntax but Elasticsearch in this context uses 'ci_raw' form that does not matches if characters are removed.
So we should do it only with Zebra.

Test plan :
 1 - Use Elasticsearch
 2 - Set sysprefs:
    RequireChoosingExistingAuthority - don't require
    AutoCreateAuthorities - generate
    CatalogModuleRelink - Do
    AutoLinkBiblio - Do
    LinkerModule - first match
 3 - Find a biblio record with an author attached to an authority
 4 - Edit this authority record and add to heading a text with parenthesis, ie '(junior)'
 5 - Edit the biblio record in advanced editor
 6 - Delete the $9 link
 7 - Save the record
 8 - It generates a new authority record
10 - Apply patch and restart all
11 - Repeat 4-5
12 - It links to the original authority
Comment 2 Fridolin Somers 2025-10-30 16:06:54 UTC
I'm trying to add a UT
Comment 3 David Cook 2025-10-31 04:47:03 UTC
Hmm I can't reproduce this one.

I'm stuck at the stage of deleting the $9 link in the advanced editor. I erase it but when I click "Save to catalog", it re-creates the linkage to the correct authority:

I'm using biblio 134 in KTD where I added (junior) onto the heading:

100 _ _ ‡aHumble, Jez. (junior)‡9926
Comment 4 Fridolin Somers 2025-10-31 07:20:07 UTC
(In reply to David Cook from comment #3)
> Hmm I can't reproduce this one.
> 
> I'm stuck at the stage of deleting the $9 link in the advanced editor. I
> erase it but when I click "Save to catalog", it re-creates the linkage to
> the correct authority:
> 
> I'm using biblio 134 in KTD where I added (junior) onto the heading:
> 
> 100 _ _ ‡aHumble, Jez. (junior)‡9926

Hi, thanks for testing.

With Elasticsearch ?
Comment 5 David Cook 2025-11-02 23:58:52 UTC
(In reply to Fridolin Somers from comment #4)
> Hi, thanks for testing.

No worries. We're almost exclusively using Elasticsearch these days, so always keen to fix ES related bugs.
 
> With Elasticsearch ?

As far as I know I was using it yeah. 

Could you try again on KTD to reproduce? Maybe I'm just doing the wrong process?