Bugzilla – Attachment 22154 Details for
Bug 9830
Some UNIMARC item indexes could be broken whith Queryweightfields syspref
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9830: Fix some indexes in UNIMARC item indexing
Bug-9830-Fix-some-indexes-in-UNIMARC-item-indexing.patch (text/plain), 12.07 KB, created by
Jonathan Druart
on 2013-10-21 12:49:06 UTC
(
hide
)
Description:
Bug 9830: Fix some indexes in UNIMARC item indexing
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-10-21 12:49:06 UTC
Size:
12.07 KB
patch
obsolete
>From 36475deee7a79f4b370cc321817ff37439460326 Mon Sep 17 00:00:00 2001 >From: Mathieu Saby <mathieu.saby@univ-rennes2.fr> >Date: Sun, 17 Mar 2013 14:54:12 +0100 >Subject: [PATCH] Bug 9830: Fix some indexes in UNIMARC item indexing > >[typo fixed in commit message ; steps 6 and 7 added in test plan] > >With this combination of sysprefs, and a UNIMARC configuration, it impossible to search on location, barcode and ccode indexes : > >QueryWeightFields is activated >QueryAutoTruncate only if * is added > >But in UNIMARC, location, barcode and ccode (995 $e,$f,h) are indexed only as "words". They need to be indexed also as "phrase" >Additionnaly, in UNIMARC, information about damaged and withdrawn status of items is not indexed, while it is done in MARC21. >This patch >- add 2 new indexes for 995$1 (damaged) and 995$3 (withdrawn) >- index location, barcode and ccode as "phrase" as well as "words" >indexing of items in UNIMARC could be improved later. So this patch also add comments explaining the origin of Koha 995, I think it could be usefull for further changes. > >To test, on a UNIMARC configuration : >A. indexed with GRS-1 >1) set sysprefs QueryWeightFields as "activated" and QueryAutoTruncate as "only if * is added" >2) select location index in advanced search and search for a value existing in your records in 995$e => 0 results >3) Apply patch >4) Rebuild zebra >5) select location index in advanced search and search for a value existing in your records in 995$e => x results >6) mark an item as withdrawn ; search "withdrawn:1" => x results, and among them the biblio to which the item is attached >7) mark an item as damaged ; search "damaged:1" => x results, and among them the biblio to which the item is attached > >B. indexed with DOM >Do the same operations > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Work as described. No koha-qa errors > >Test >Apply the patch >Begin with GRS-1 >Full reindex >Search by location, no results >cp files biblio-*-indexdefs.xml and record.abs to destination on etc/zebra >Full reindex >Search by location, got results > >Switch to DOM >reset files >Full reindex >Search by location, no results >cp files >Full reindex >Search by location, results ! > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > .../unimarc/biblios/biblio-koha-indexdefs.xml | 23 ++++- > .../unimarc/biblios/biblio-zebra-indexdefs.xsl | 20 +++- > etc/zebradb/marc_defs/unimarc/biblios/record.abs | 98 +++++++++++++++++--- > 3 files changed, 120 insertions(+), 21 deletions(-) > >diff --git a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml b/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >index fdd1dfe..3d926a3 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >@@ -1562,12 +1562,24 @@ > <target_index>Local-classification:w</target_index> > <target_index>Local-classification:p</target_index> > </index_data_field> >- <!--record.abs line 331: melm 995$2 lost,lost:n,item--> >+ <!--record.abs melm 995$1 damaged,damaged:n,item--> >+ <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="995" subfields="1"> >+ <target_index>damaged:w</target_index> >+ <target_index>damaged:n</target_index> >+ <target_index>item:w</target_index> >+ </index_subfields> >+ <!--record.abs melm 995$2 lost,lost:n,item--> > <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="995" subfields="2"> > <target_index>lost:w</target_index> > <target_index>lost:n</target_index> > <target_index>item:w</target_index> > </index_subfields> >+ <!--record.abs melm 995$3 withdrawn,withdrawn:n,item--> >+ <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="995" subfields="3"> >+ <target_index>withdrawn:w</target_index> >+ <target_index>withdrawn:n</target_index> >+ <target_index>item:w</target_index> >+ </index_subfields> > <!--record.abs line 332: melm 995$a homebranch,Host-item,item--> > <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="995" subfields="a"> > <target_index>homebranch:w</target_index> >@@ -1592,19 +1604,22 @@ > <target_index>Record-Source:w</target_index> > <target_index>item:w</target_index> > </index_subfields> >- <!--record.abs line 336: melm 995$e location,item--> >+ <!--record.abs melm 995$e location,location:p,item--> > <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="995" subfields="e"> > <target_index>location:w</target_index> >+ <target_index>location:p</target_index> > <target_index>item:w</target_index> > </index_subfields> >- <!--record.abs line 337: melm 995$f barcode,item--> >+ <!--record.abs line 337: melm 995$f barcode,barcode:p,item--> > <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="995" subfields="f"> > <target_index>barcode:w</target_index> >+ <target_index>barcode:p</target_index> > <target_index>item:w</target_index> > </index_subfields> >- <!--record.abs line 338: melm 995$h ccode,item--> >+ <!--record.abs line 338: melm 995$h ccode,ccode:p,item--> > <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="995" subfields="h"> > <target_index>ccode:w</target_index> >+ <target_index>ccode:p</target_index> > <target_index>item:w</target_index> > </index_subfields> > <!--record.abs line 339: melm 995$j LC-card-number:s,item--> >diff --git a/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >index 99cbdbc..de3f06f 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >@@ -370,6 +370,13 @@ 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('1', @code)"> >+ <z:index name="damaged:w damaged:n item:w"> >+ <xslo:value-of select="."/> >+ </z:index> >+ </xslo:if> >+ </xslo:for-each> >+ <xslo:for-each select="marc:subfield"> > <xslo:if test="contains('2', @code)"> > <z:index name="lost:w lost:n item:w"> > <xslo:value-of select="."/> >@@ -377,6 +384,13 @@ 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('3', @code)"> >+ <z:index name="withdrawn:w withdrawn:n item:w"> >+ <xslo:value-of select="."/> >+ </z:index> >+ </xslo:if> >+ </xslo:for-each> >+ <xslo:for-each select="marc:subfield"> > <xslo:if test="contains('a', @code)"> > <z:index name="homebranch:w Host-item:w item:w"> > <xslo:value-of select="."/> >@@ -406,21 +420,21 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:for-each> > <xslo:for-each select="marc:subfield"> > <xslo:if test="contains('e', @code)"> >- <z:index name="location:w item:w"> >+ <z:index name="location:w location:p item:w"> > <xslo:value-of select="."/> > </z:index> > </xslo:if> > </xslo:for-each> > <xslo:for-each select="marc:subfield"> > <xslo:if test="contains('f', @code)"> >- <z:index name="barcode:w item:w"> >+ <z:index name="barcode:w barcode:p item:w"> > <xslo:value-of select="."/> > </z:index> > </xslo:if> > </xslo:for-each> > <xslo:for-each select="marc:subfield"> > <xslo:if test="contains('h', @code)"> >- <z:index name="ccode:w item:w"> >+ <z:index name="ccode:w ccode:p item:w"> > <xslo:value-of select="."/> > </z:index> > </xslo:if> >diff --git a/etc/zebradb/marc_defs/unimarc/biblios/record.abs b/etc/zebradb/marc_defs/unimarc/biblios/record.abs >index dfcd8b8..aa0f74d 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/record.abs >+++ b/etc/zebradb/marc_defs/unimarc/biblios/record.abs >@@ -496,20 +496,90 @@ melm 680 LC-call-number:w,LC-call-number:p > # Other class numbers // see Marc21 084 > melm 686 Local-classification:w,Local-classification:p > >-#############"# item information (based on 995) ############### >-melm 995$2 lost,lost:n,item >-melm 995$a homebranch,Host-item,item >-melm 995$b homebranch,Host-item,item >-melm 995$c holdingbranch,Record-Source,item >-melm 995$d holdingbranch,Record-Source,item >-melm 995$e location,item >-melm 995$f barcode,item >-melm 995$h ccode,item >-melm 995$j LC-card-number:s,item >-melm 995$k Call-Number,Local-classification,lcn,Call-Number:p,Local-classification:p,lcn:p,item,Local-classification:s >-melm 995$n onloan:d,onloan:n,onloan:s,onloan:w,item >-melm 995$u Note,Note:p,item >-melm 995 item # just to index every subfield >+ >+############## KOHA ITEM INFORMATION (based on 995) ############### >+# Koha specific : $1, $2, $3 >+melm 995$1 damaged,damaged:n >+melm 995$2 lost,lost:n >+melm 995$3 withdrawn,withdrawn:n >+ >+# most subfields are based on "995 recommandation" >+# used by French libraries for exchanging holding information >+# source: http://www.abes.fr/content/download/1949/8319/version/1/file/pdf_r995.pdf >+# (last version, 2005) >+# Note that : >+# - the use of $e,$h,$j in Koha and in 995 recommandation is different >+# - $i, $m, $l, $o, $p, $q, $v, $w, $x, $y, $z are defined in 995 recommandation, but not used by Koha >+ >+# 6 blocs of subfields are defined in 995 recommandation >+ >+# 1. Information about origin of the document >+# $a - Origin of the document, free text >+# Not used in Sudoc network >+melm 995$a homebranch,Host-item,item >+# $a - Origin of the document, coded information >+melm 995$b homebranch,Host-item,item >+# $c - Lending or holding library - free text >+melm 995$c holdingbranch,Record-Source,item >+# $d - Lending or holding library - coded information >+melm 995$d holdingbranch,Record-Source,item >+ >+# 2. Identification and classification >+# $e - shelving information >+# (in 995 recommandation : $e - detailed genre) >+melm 995$e location,location:p,item >+# $f - barcode - complete >+melm 995$f barcode,barcode:p,item >+# $h - ccode >+# (in 995 recommandation : $h - barcode - prefix) >+melm 995$h ccode,ccode:p,item >+# $i - not used currently >+# (in 995 recommandation : $i - barcode - suffix) >+# $j - LC-card-number, >+# (in 995 recommandation : $j - section, i.e. part of a library) >+melm 995$j LC-card-number:s,item >+# $k - callnumber >+melm 995$k Call-Number,Local-classification,Call-Number:p,Local-classification:p,Local-classification:s,item >+# $l - not used currently >+# (in 995 recommandation : $l - volumes) >+ >+# 3 - Checkout and deposal information >+# $m - not used currently >+# (in 995 recommandation : $m - Date of loan or deposit) >+# $n - Expiration of loan >+melm 995$n onloan:d,onloan:n,onloan:s,onloan:w,item >+# $o - not used currently >+# (in 995 recommandation : $o - Circulation type (not for loan)) >+ >+# 4 - Sorting and statistic information >+# $p - not used currently >+# (in 955 recommandation : $p - Serial) >+# $q - not used currently >+# (in 995 recommandation : $q - Target audience (age)) >+# $r - Type of document and carriage >+melm 995$r itemtype:w,itemtype:p,itype:w,itype:p,item >+# $s - not used currently >+# (in 995 recommandation : $s - Sorting element) >+# $t - not used currently >+# (in 995 recommandation : $t - Genre : fiction vs non-fiction) >+ >+# 5 - Notes >+# $u - item note >+melm 995$u Note,Note:p,item >+# $v - not used currently >+# (in 995 recommandation : $v - serial issue note) >+ >+# 6 - Target of document >+# $w - not used currently >+# (in 995 recommandation : $w - target library - free text) >+# $x - not used currently >+# (in 995 recommandation : $x - target library - coded information) >+# $y - not used currently >+# (in 995 recommandation : $y - target network of libraries - free text) >+# $z - not used currently >+# (in 995 recommandation : $z - target network of libraries - coded information) >+ >+melm 995 item # just to index every subfield > > ### biblioitems information (based on 942) ###### > melm 942$0 totalissues:n,totalissues:s >-- >1.7.10.4
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 9830
:
16198
|
21060
|
21977
| 22154