Bugzilla – Attachment 16198 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]
[PATCH] Bug 9830: Fix some indexes in UNIMARC item indexing
0007-Bug-9830-Fix-some-indexes-in-UNIMARC-item-indexing.patch (text/plain), 11.25 KB, created by
Mathieu Saby
on 2013-03-17 14:55:29 UTC
(
hide
)
Description:
[PATCH] Bug 9830: Fix some indexes in UNIMARC item indexing
Filename:
MIME Type:
Creator:
Mathieu Saby
Created:
2013-03-17 14:55:29 UTC
Size:
11.25 KB
patch
obsolete
>From 5ee891e9d0fec8fa6839a599ac4d7113e7ad7be0 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 > >With this combinaison 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 lost 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 (lost) >index location, barcode and ccode as "phrase" as well as "words" >indexing of items in UNIMARC could be improved. I 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 GR1 >1) set sysprefs QueryWeightFields as "activated" and QueryAutoTruncate as "only if * is adde" >2) select location index in advanced search and search for a value existing in your records in 995$e. >3) 0 results >4) Apply patch >5) Rebuild zebra >6) select location index in advanced search and search for a value existing in your records in 995$e. >7) x results > >B. indexed with DOM >Do the same operations > >--- > .../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 ceaba51..1f78f5e 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >@@ -1498,12 +1498,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> >@@ -1528,19 +1540,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 f1e82e3..1cbf184 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >@@ -369,6 +369,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="."/> >@@ -376,6 +383,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="."/> >@@ -405,21 +419,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 44a5bbe..6a359f8 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/record.abs >+++ b/etc/zebradb/marc_defs/unimarc/biblios/record.abs >@@ -480,20 +480,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.9.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 9830
:
16198
|
21060
|
21977
|
22154