From 700de9664d0e9016845d12916905e458cab9dbd4 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Tue, 5 Apr 2011 14:13:51 +0200 Subject: [PATCH] (Bug 4049) Searching itemtypes returning noise Fix the problem of searching on partial itemtypes strings for instance, itemtype="ARTICLE DE PERIODIQUE", itemtype="PERIODIQUE" searching on itemtype="PERIODIQUE" would also get "ARTICLE DE PERIODIQUE" Signed-off-by: Jonathan Druart Signed-off-by: Chris Cormack --- catalogue/search.pl | 2 +- etc/zebradb/marc_defs/marc21/biblios/record.abs | 6 +++--- etc/zebradb/marc_defs/unimarc/biblios/record.abs | 10 +++++++--- opac/opac-search.pl | 4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index 17cbdccf94..85bccdf4e8 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -250,7 +250,7 @@ my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes"); if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { my %row =( number=>$cnt++, - ccl => $itype_or_itemtype, + ccl => qq($itype_or_itemtype,phr), code => $thisitemtype, selected => $selected, description => $itemtypes->{$thisitemtype}->{'description'}, diff --git a/etc/zebradb/marc_defs/marc21/biblios/record.abs b/etc/zebradb/marc_defs/marc21/biblios/record.abs index 5cd5612c83..6826d4aa18 100755 --- a/etc/zebradb/marc_defs/marc21/biblios/record.abs +++ b/etc/zebradb/marc_defs/marc21/biblios/record.abs @@ -268,7 +268,7 @@ melm 999$d biblioitemnumber:n,biblioitemnumber:w,biblioitemnumber:s melm 942$0 totalissues:n,totalissues:s melm 942$2 cn-bib-source melm 942$6 cn-bib-sort:n,cn-bib-sort:s -melm 942$c itemtype:w +melm 942$c itemtype:w,itemtype:p melm 942$n Suppress:w,Suppress:n # need to check bib1 @@ -286,7 +286,7 @@ melm 952$4 damaged:n,damaged:w melm 952$5 restricted:n,restricted:w melm 952$6 cn-sort:n,cn-sort:s melm 952$7 notforloan:n,notforloan:w -melm 952$8 ccode +melm 952$8 ccode:w,ccode:p melm 952$9 itemnumber:n,itemnumber:s melm 952$a homebranch melm 952$b holdingbranch @@ -314,5 +314,5 @@ melm 952$u uri:u melm 952$v replacementprice melm 952$w replacementpricedate #melm 952$x -melm 952$y itype:w +melm 952$y itype:w,itype:p melm 952$z Note:w,Note:p diff --git a/etc/zebradb/marc_defs/unimarc/biblios/record.abs b/etc/zebradb/marc_defs/unimarc/biblios/record.abs index 570b112649..e8e1576883 100644 --- a/etc/zebradb/marc_defs/unimarc/biblios/record.abs +++ b/etc/zebradb/marc_defs/unimarc/biblios/record.abs @@ -39,8 +39,8 @@ melm 011$y ISSN:w,Identifier-standard:w # wrong ISSN melm 011$z ISSN:w,Identifier-standard:w -melm 200$b itemtype:w,itype:w -melm 995$r itemtype:w,itype:w +melm 200$b itemtype:w,itemtype:p,itype:w,itype:p +melm 995$r itemtype:w,itemtype:p,itype:w,itype:p melm 100$a tpubdate:s:range(data,8,1),ta:w:range(data,17,1),ta:w:range(data,18,1),ta:w:range(data,19,1),Modified-code:n:range(data,21,1),ln:s:range(data,22,3),char-encoding:n:range(data,26,2),char-encoding:n:range(data,28,2),char-encoding:n:range(data,30,2),script-Title:n:range(data,34,2) melm 101$a ln @@ -56,7 +56,7 @@ melm 102$a Country-heading #Biography code 1 melm 105$a Illustration-code:w:range(data,0,4),Content-type:w:range(data,4,1),Content-type:w:range(data,5,1),Content-type:w:range(data,6,1),Content-type:w:range(data,7,1),Conference-code:w:range(data,8,1),Festschrift-indicator:w:range(data,9,1),Index-indicator:w:range(data,10,1),Literature-Code:w:range(data,11,1),Biography-Code:w:range(data,12,1) -melm 106$a itype +melm 106$a itype:w,itype:p #Field 110 Description #Name of Data Element Number of characters Character Positions @@ -80,6 +80,10 @@ melm 680$b LC-call-number:s melm 680 LC-call-number #melm 001 Identifier-standard:w +<<<<<<< HEAD +======= +melm 200$b itype:w,itype:p +>>>>>>> (Bug 4049) Searching itemtypes returning noise #melm 100$9 Cross-Reference !:w diff --git a/opac/opac-search.pl b/opac/opac-search.pl index e2725fa805..6dde2fd292 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -164,8 +164,8 @@ my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes"); if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { - my %row =( number=>$cnt++, - ccl => $itype_or_itemtype, + my %row =( number=>$cnt++, + ccl => "$itype_or_itemtype,phr", code => $thisitemtype, selected => $selected, description => $itemtypes->{$thisitemtype}->{'description'}, -- 2.39.5