Linking biblio headings to authorities fails if there is subdivision(s) to search. Test plan (Unimarc example): - AutoCreateAuthorities On - BiblioAddsAuthorities On - add a subject in a biblio: 606 $aArt $xHistory => new authority is created - reindex authorities if Zebra search engine - add same subject in an other biblio: 606 $aArt $xHistory => again, a new authority is created Heading helper adds the subdiviion name in the search term. So the entire search query for mathing authorities is "Art generalsubdiv History" I'm looking for a fix, but i need someone to explain me why we add something which is similar to metada in the search term. This is done both for MARC21 and UNIMARC in C4::Heading::UNIMARC::_get_search_heading and C4::Heading::MARC21::_get_search_heading
Created attachment 126306 [details] [review] Bug 29191: Don't include subdivision names in heading search form with Elasticsearch
Changed the component to Searching - Elasticsearch since it works with Zebra with the correct configuration: authority-koha-indexdefs.xml index the subdivision names in match-heading. I don't know how to make this configurable with Elasticsearch. So here is the quick fix that prevent adding subdivisions in search form for ES. Alex
This is a bug not an enhancement right ?
(In reply to Fridolin Somers from comment #3) > This is a bug not an enhancement right ? yes. Changed to normal. Thx!
By 2021 you should have had the fix for bug 24269 and thus should have had the subdivision metadata indexed in ES, shouldn't you?
(In reply to Phil Ringnalda from comment #5) > By 2021 you should have had the fix for bug 24269 and thus should have had > the subdivision metadata indexed in ES, shouldn't you? it looks like the mappings weren't updated for UNIMARC. But maybe this would be the preferrable fix here?
Mmm, mappings. The point of bug 24269 and bug 25273 was that you cannot do any better than Koha by mapping match-heading, because match-heading is only searched by the linker, and the linker will search for the search_form of the heading, so any mapping other than exactly that can only fail or return worse results. If you don't have any mapping at all for match-heading, then that's perfect, because Koha will build one by calling $heading->search_form and stuffing that into the index. However, I know from having a service-provider-provided mapping file that had outdated mappings for match-heading that if you do have them, they will still be used, and will break things. That's probably where Alex was in 2021, with code that would have indexed headings as "Art generalsubdiv History" but with a match-heading mapping that prevented it from successfully doing so.