Bugzilla – Attachment 192105 Details for
Bug 41210
Author field searches do not include enough fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41210: Adjust ES and Zebra mappings
Bug-41210-Adjust-ES-and-Zebra-mappings.patch (text/plain), 13.53 KB, created by
Nick Clemens (kidclamp)
on 2026-01-27 20:11:13 UTC
(
hide
)
Description:
Bug 41210: Adjust ES and Zebra mappings
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2026-01-27 20:11:13 UTC
Size:
13.53 KB
patch
obsolete
>From 4ac2063039244bb45edfa4de2fac3ea02a5c9d77 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 27 Jan 2026 20:08:08 +0000 >Subject: [PATCH] Bug 41210: Adjust ES and Zebra mappings > >This fixes the issue for ES. > >For zebra I cannot get the search to work - I believe I added the fields and updated correctly but putting this on the bug for testiing: > >For SearchEngine Elasticsearch >1 - Apply patch >2 - perl misc/search_tools/rebuild_elasticsearch.pl -r -v >3 - Add sample record as stated in bug >4 - Confirm all links work > >For SearchEngine Zebra >1 - Apply patch >2 - sudo cp /kohadevbox/koha/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >3 - restart_all >4 - sudo koha-rebuild-zebra -v -f kohadev >5 - Confirm all links in record work >6 - They don't currently >--- > .../searchengine/elasticsearch/mappings.yaml | 12 ++-- > .../marc21/biblios/biblio-koha-indexdefs.xml | 40 +++++++++---- > .../marc21/biblios/biblio-zebra-indexdefs.xsl | 60 ++++++++++++++++--- > 3 files changed, 86 insertions(+), 26 deletions(-) > >diff --git a/admin/searchengine/elasticsearch/mappings.yaml b/admin/searchengine/elasticsearch/mappings.yaml >index 6f69baf4834..e7561cf574f 100644 >--- a/admin/searchengine/elasticsearch/mappings.yaml >+++ b/admin/searchengine/elasticsearch/mappings.yaml >@@ -1051,17 +1051,17 @@ biblios: > mandatory: ~ > mappings: > - facet: 1 >- marc_field: 100a >+ marc_field: 100abcjq(abcjq) > marc_type: marc21 > sort: 1 > suggestible: 1 > - facet: 1 >- marc_field: 110a >+ marc_field: 110ab(ab) > marc_type: marc21 > sort: 1 > suggestible: 1 > - facet: 1 >- marc_field: 111a >+ marc_field: 111aeq(aeq) > marc_type: marc21 > sort: 1 > suggestible: 1 >@@ -1071,17 +1071,17 @@ biblios: > sort: 1 > suggestible: '' > - facet: 1 >- marc_field: 700a >+ marc_field: 700abcjq(abcjq) > marc_type: marc21 > sort: 1 > suggestible: 1 > - facet: 1 >- marc_field: 710a >+ marc_field: 710ab(ab) > marc_type: marc21 > sort: 1 > suggestible: 1 > - facet: 1 >- marc_field: 711a >+ marc_field: 711aeq(aeq) > marc_type: marc21 > sort: 1 > suggestible: 1 >diff --git a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >index e2ab9205ca0..bdec18593de 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >@@ -269,7 +269,7 @@ > <target_index>Koha-Auth-Number:w</target_index> > </index_subfields> > <!--record.abs line 91: melm 100$a Author,Author:p,Author:s,Editor,Author-personal-bibliography,Author-personal-bibliography:p,Author-personal-bibliography:s--> >- <index_subfields tag="100" subfields="a"> >+ <index_subfields tag="100" subfields="abcjq"> > <target_index>Author:w</target_index> > <target_index>Author:p</target_index> > <target_index>Author:s</target_index> >@@ -280,9 +280,6 @@ > </index_subfields> > <!--record.abs line 92: melm 100 Author,Author:p,Author:s,Author-title,Author-name-personal,Name,Name-and-title,Personal-name--> > <index_data_field tag="100"> >- <target_index>Author:w</target_index> >- <target_index>Author:p</target_index> >- <target_index>Author:s</target_index> > <target_index>Author-title:w</target_index> > <target_index>Author-name-personal:w</target_index> > <target_index>Name:w</target_index> >@@ -294,6 +291,17 @@ > <target_index>Koha-Auth-Number:w</target_index> > </index_subfields> > <!--record.abs line 94: melm 110 Author,Author:p,Author:s,Author-title,Author-name-corporate,Name,Name-and-title,Corporate-name--> >+ <index_data_field tag="110" subfields="ab"> >+ <target_index>Author:w</target_index> >+ <target_index>Author:p</target_index> >+ <target_index>Author:s</target_index> >+ <target_index>Author-title:w</target_index> >+ <target_index>Author-name-corporate:w</target_index> >+ <target_index>Name:w</target_index> >+ <target_index>Name-and-title:w</target_index> >+ <target_index>Corporate-name:w</target_index> >+ <target_index>Corporate-name:p</target_index> >+ </index_data_field> > <index_data_field tag="110"> > <target_index>Author:w</target_index> > <target_index>Author:p</target_index> >@@ -310,10 +318,12 @@ > <target_index>Koha-Auth-Number:w</target_index> > </index_subfields> > <!--record.abs line 96: melm 111 Author,Author:p,Author:s,Author-title,Author-name-corporate,Name,Name-and-title,Conference-name--> >- <index_data_field tag="111"> >+ <index_data_field tag="111" subfields="aeq"> > <target_index>Author:w</target_index> > <target_index>Author:p</target_index> > <target_index>Author:s</target_index> >+ </index_data_field> >+ <index_data_field tag="111"> > <target_index>Author-title:w</target_index> > <target_index>Author-name-corporate:w</target_index> > <target_index>Name:w</target_index> >@@ -880,10 +890,11 @@ > <target_index>Cross-Reference:w</target_index> > <target_index>Koha-Auth-Number:w</target_index> > </index_subfields> >- <!--record.abs line 201: melm 700$a Author,Author:p--> >- <index_subfields tag="700" subfields="a"> >+ <!--record.abs line 201: melm 700$abcjq Author,Author:p--> >+ <index_subfields tag="700" subfields="abcjq"> > <target_index>Author:w</target_index> > <target_index>Author:p</target_index> >+ <target_index>Author:s</target_index> > </index_subfields> > <!--record.abs line 202: melm 700$n Thematic-number--> > <index_subfields tag="700" subfields="n"> >@@ -902,8 +913,6 @@ > </index_subfields> > <!--record.abs line 206: melm 700 Author,Author:p,Author-name-personal,Name,Editor,Personal-name--> > <index_data_field tag="700"> >- <target_index>Author:w</target_index> >- <target_index>Author:p</target_index> > <target_index>Author-name-personal:w</target_index> > <target_index>Name:w</target_index> > <target_index>Editor:w</target_index> >@@ -917,7 +926,7 @@ > <target_index>Title-uniform:w</target_index> > </index_subfields> > <!--record.abs line 210: melm 710$a Name-and-title--> >- <index_subfields tag="710" subfields="a"> >+ <index_subfields tag="710" subfields="ab"> > <target_index>Name-and-title:w</target_index> > </index_subfields> > <!--record.abs line 211: melm 710$9 Koha-Auth-Number --> >@@ -925,13 +934,18 @@ > <target_index>Koha-Auth-Number:w</target_index> > </index_subfields> > <!--record.abs line 212: melm 710 Author,Author:p,Corporate-name,Name--> >- <index_data_field tag="710"> >+ <index_data_field tag="710" subfields="ab"> > <target_index>Author:w</target_index> > <target_index>Author:p</target_index> > <target_index>Corporate-name:w</target_index> > <target_index>Corporate-name:p</target_index> > <target_index>Name:w</target_index> > </index_data_field> >+ <index_data_field tag="710"> >+ <target_index>Corporate-name:w</target_index> >+ <target_index>Corporate-name:p</target_index> >+ <target_index>Name:w</target_index> >+ </index_data_field> > <!--record.abs line 213: melm 711$a Name-and-title--> > <index_subfields tag="711" subfields="a"> > <target_index>Name-and-title:w</target_index> >@@ -947,9 +961,11 @@ > <target_index>Koha-Auth-Number:w</target_index> > </index_subfields> > <!--record.abs line 218: melm 711 Author,Author:p,Author-name-corporate,Name,Conference-name--> >- <index_data_field tag="711"> >+ <index_data_field tag="711" subfields="aeq"> > <target_index>Author:w</target_index> > <target_index>Author:p</target_index> >+ </index_data_field> >+ <index_data_field tag="711"> > <target_index>Author-name-corporate:w</target_index> > <target_index>Name:w</target_index> > <target_index>Conference-name:w</target_index> >diff --git a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >index c540d485f3a..9ef776a1636 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >@@ -254,7 +254,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:for-each> > <xslo:for-each select="marc:subfield"> >- <xslo:if test="contains('a', @code)"> >+ <xslo:if test="contains('abcjq', @code)"> > <z:index name="Author:w Author:p Author:s Editor:w Author-personal-bibliography:w Author-personal-bibliography:p Author-personal-bibliography:s"> > <xslo:value-of select="."/> > </z:index> >@@ -849,8 +849,8 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:for-each> > <xslo:for-each select="marc:subfield"> >- <xslo:if test="contains('a', @code)"> >- <z:index name="Author:w Author:p"> >+ <xslo:if test="contains('abcjq', @code)"> >+ <z:index name="Author:w Author:p Author:s"> > <xslo:value-of select="."/> > </z:index> > </xslo:if> >@@ -886,7 +886,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:for-each> > <xslo:for-each select="marc:subfield"> >- <xslo:if test="contains('a', @code)"> >+ <xslo:if test="contains('ab', @code)"> > <z:index name="Name-and-title:w"> > <xslo:value-of select="."/> > </z:index> >@@ -1912,7 +1912,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </z:index> > </xslo:template> > <xslo:template mode="index_data_field" match="marc:datafield[@tag='100']"> >- <z:index name="Author:w Author:p Author:s Author-title:w Author-name-personal:w Name:w Name-and-title:w Personal-name:w"> >+ <z:index name="Author-title:w Author-name-personal:w Name:w Name-and-title:w Personal-name:w"> > <xslo:variable name="raw_heading"> > <xslo:for-each select="marc:subfield"> > <xslo:if test="position() > 1"> >@@ -1936,9 +1936,31 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:variable> > <xslo:value-of select="normalize-space($raw_heading)"/> > </z:index> >+ <z:index name="Author:w Author:p Author:s Author-title:w Author-name-corporate:w Name:w Name-and-title:w Corporate-name:w Corporate-name:p"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="position() > 1"> >+ <xslo:value-of select="substring(' ', 1, 1)"/> >+ </xslo:if> >+ <xslo:value-of select="."/> >+ </xslo:for-each> >+ </xslo:variable> >+ <xslo:value-of select="normalize-space($raw_heading)"/> >+ </z:index> > </xslo:template> > <xslo:template mode="index_data_field" match="marc:datafield[@tag='111']"> >- <z:index name="Author:w Author:p Author:s Author-title:w Author-name-corporate:w Name:w Name-and-title:w Conference-name:w"> >+ <z:index name="Author:w Author:p Author:s"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="position() > 1"> >+ <xslo:value-of select="substring(' ', 1, 1)"/> >+ </xslo:if> >+ <xslo:value-of select="."/> >+ </xslo:for-each> >+ </xslo:variable> >+ <xslo:value-of select="normalize-space($raw_heading)"/> >+ </z:index> >+ <z:index name="Author-title:w Author-name-corporate:w Name:w Name-and-title:w Conference-name:w"> > <xslo:variable name="raw_heading"> > <xslo:for-each select="marc:subfield"> > <xslo:if test="position() > 1"> >@@ -2445,7 +2467,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </z:index> > </xslo:template> > <xslo:template mode="index_data_field" match="marc:datafield[@tag='700']"> >- <z:index name="Author:w Author:p Author-name-personal:w Name:w Editor:w Personal-name:w"> >+ <z:index name="Author-name-personal:w Name:w Editor:w Personal-name:w"> > <xslo:variable name="raw_heading"> > <xslo:for-each select="marc:subfield"> > <xslo:if test="position() > 1"> >@@ -2469,9 +2491,31 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:variable> > <xslo:value-of select="normalize-space($raw_heading)"/> > </z:index> >+ <z:index name="Corporate-name:w Corporate-name:p Name:w"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="position() > 1"> >+ <xslo:value-of select="substring(' ', 1, 1)"/> >+ </xslo:if> >+ <xslo:value-of select="."/> >+ </xslo:for-each> >+ </xslo:variable> >+ <xslo:value-of select="normalize-space($raw_heading)"/> >+ </z:index> > </xslo:template> > <xslo:template mode="index_data_field" match="marc:datafield[@tag='711']"> >- <z:index name="Author:w Author:p Author-name-corporate:w Name:w Conference-name:w"> >+ <z:index name="Author:w Author:p"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="position() > 1"> >+ <xslo:value-of select="substring(' ', 1, 1)"/> >+ </xslo:if> >+ <xslo:value-of select="."/> >+ </xslo:for-each> >+ </xslo:variable> >+ <xslo:value-of select="normalize-space($raw_heading)"/> >+ </z:index> >+ <z:index name="Author-name-corporate:w Name:w Conference-name:w"> > <xslo:variable name="raw_heading"> > <xslo:for-each select="marc:subfield"> > <xslo:if test="position() > 1"> >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41210
:
189226
|
189624
| 192105