From 09d0018a02fa08b45fa26859dbcdd33025bf3df3 Mon Sep 17 00:00:00 2001 From: Mathieu Saby Date: Sun, 17 Mar 2013 14:54:12 +0100 Subject: [PATCH] [SIGNED-OFF] 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 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 ! --- .../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 @@ Local-classification:w Local-classification:p - + + + damaged:w + damaged:n + item:w + + lost:w lost:n item:w + + + withdrawn:w + withdrawn:n + item:w + homebranch:w @@ -1528,19 +1540,22 @@ Record-Source:w item:w - + location:w + location:p item:w - + barcode:w + barcode:p item:w - + ccode:w + ccode:p item:w 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) + + + + + + + @@ -376,6 +383,13 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + + + + + + + @@ -405,21 +419,21 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) - + - + - + diff --git a/etc/zebradb/marc_defs/unimarc/biblios/record.abs b/etc/zebradb/marc_defs/unimarc/biblios/record.abs index dd481b6..eb345f4 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