From f37649b7320710560e519245f18890b4fdd634a2 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Mon, 18 Jan 2010 14:16:27 +0100 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" --- catalogue/search.pl | 2 +- etc/zebradb/marc_defs/marc21/biblios/record.abs | 6 +++--- etc/zebradb/marc_defs/unimarc/biblios/record.abs | 8 ++++---- opac/opac-search.pl | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index 49942dbc3a..c5070e9a50 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -231,7 +231,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 47be88f56b..6135963aa1 100644 --- a/etc/zebradb/marc_defs/marc21/biblios/record.abs +++ b/etc/zebradb/marc_defs/marc21/biblios/record.abs @@ -245,7 +245,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 @@ -263,7 +263,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 @@ -291,5 +291,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 6188c6adfc..e08c7d359d 100644 --- a/etc/zebradb/marc_defs/unimarc/biblios/record.abs +++ b/etc/zebradb/marc_defs/unimarc/biblios/record.abs @@ -37,8 +37,8 @@ melm 011$y ISSN:w,Identifier-standard:w # wrong ISSN melm 011$z ISSN:w,Identifier-standard:w -melm 200$b itemtype:w -melm 995$r itype:w +melm 200$b itemtype:w,itemtype:p +melm 995$r 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 @@ -54,7 +54,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 @@ -78,7 +78,7 @@ melm 680$b LC-call-number:s melm 680 LC-call-number #melm 001 Identifier-standard:w -melm 200$b itype +melm 200$b itype:w,itype:p #melm 100$9 Cross-Reference !:w diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 74f8fe5ecf..63435a5640 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -133,7 +133,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 => "$itype_or_itemtype,phr", code => $thisitemtype, selected => $selected, description => $itemtypes->{$thisitemtype}->{'description'}, -- 2.39.5