Bugzilla – Attachment 46098 Details for
Bug 14277
Search index 'lex' does not honor MARC indicator "ind1"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14277 add zebra indexes for lexile that respect 521 indicator 1.
Bug-14277-add-zebra-indexes-for-lexile-that-respec.patch (text/plain), 8.32 KB, created by
Nick Clemens (kidclamp)
on 2015-12-30 18:55:19 UTC
(
hide
)
Description:
Bug 14277 add zebra indexes for lexile that respect 521 indicator 1.
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2015-12-30 18:55:19 UTC
Size:
8.32 KB
patch
obsolete
>From a69071cb979372c0617ed87723470c10084f411a Mon Sep 17 00:00:00 2001 >From: Barton Chittenden <barton@bywatersolutions.com> >Date: Thu, 17 Dec 2015 09:17:23 -0800 >Subject: [PATCH] Bug 14277 add zebra indexes for lexile that respect 521 > indicator 1. > >Added the following indexes: > >Interest-age-level | 591$a ind1=1 >Interest-grade-level | 591$a ind1=2 >lexile-number | 591$a ind1=8 >Reading-grade-level | 591$a ind1=0 > >Moved 'lex' from a zebra index to a ccl alias to lexile-number. > >Changed the handling of st-numeric in C4/Search.pm to allow for search ranges. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Search.pm | 14 ++++++- > etc/zebradb/biblios/etc/bib1.att | 6 ++- > etc/zebradb/ccl.properties | 6 ++- > .../marc21/biblios/biblio-koha-indexdefs.xml | 24 +++++++++--- > .../marc21/biblios/biblio-zebra-indexdefs.xsl | 43 ++++++++++++++++++---- > 5 files changed, 77 insertions(+), 16 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index e217f60..a9d05eb 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1021,6 +1021,11 @@ sub _build_weighted_query { > $weighted_query .= "an=\"$operand\""; > } > >+ # If the index is numeric, don't autoquote it. >+ elsif ( $index =~ /,st-numeric$/ ) { >+ $weighted_query .= " $index=$operand"; >+ } >+ > # If the index already has more than one qualifier, wrap the operand > # in quotes and pass it back (assumption is that the user knows what they > # are doing and won't appreciate us mucking up their query >@@ -1124,6 +1129,8 @@ sub getIndexes{ > 'Illustration-code', > 'Index-term-genre', > 'Index-term-uncontrolled', >+ 'Interest-age-level', >+ 'Interest-grade-level', > 'ISBN', > 'isbn', > 'ISSN', >@@ -1138,6 +1145,7 @@ sub getIndexes{ > 'LC-card-number', > 'lcn', > 'lex', >+ 'lexile-number', > 'llength', > 'ln', > 'ln-audio', >@@ -1174,6 +1182,7 @@ sub getIndexes{ > 'Publisher', > 'Provider', > 'pv', >+ 'Reading-grade-level', > 'Record-control-number', > 'rcn', > 'Record-type', >@@ -1515,8 +1524,8 @@ sub buildQuery { > #which is processed higher up in this sub. Other than that, year searches are typically > #handled as limits which are not processed her either. > >- # Date of Publication >- if ( $index =~ /yr/ ) { >+ # Search ranges: Date of Publication, st-numeric >+ if ( $index =~ /(yr|st-numeric)/ ) { > #weight_fields/relevance search causes errors with date ranges > #In the case of YYYY-, it will only return records with a 'yr' of YYYY (not the range) > #In the case of YYYY-YYYY, it will return no results >@@ -1745,6 +1754,7 @@ sub buildQuery { > warn "LIMIT DESC:" . $limit_desc; > warn "---------\nLeave buildQuery\n---------"; > } >+ > return ( > undef, $query, $simple_query, $query_cgi, > $query_desc, $limit, $limit_cgi, $limit_desc, >diff --git a/etc/zebradb/biblios/etc/bib1.att b/etc/zebradb/biblios/etc/bib1.att >index d34325a..ff63a36 100644 >--- a/etc/zebradb/biblios/etc/bib1.att >+++ b/etc/zebradb/biblios/etc/bib1.att >@@ -351,7 +351,11 @@ att 9900 Author-personal-bibliography > # Author-in-order - firstname lastname in 245$c statement of responsibility > att 9902 Author-in-order > # Lexile number >-att 9903 lex >+att 9903 lexile-number >+att 9908 Interest-age-level >+att 9909 Interest-grade-level >+att 9910 Reading-grade-level >+ > att 9904 arl > att 9013 arp > att 9520 Item >diff --git a/etc/zebradb/ccl.properties b/etc/zebradb/ccl.properties >index f65d269..58c38c9 100644 >--- a/etc/zebradb/ccl.properties >+++ b/etc/zebradb/ccl.properties >@@ -1135,7 +1135,11 @@ ff7-01-02 1=8703 > l-format ff7-01-02 > > # Lexile Number >-lex 1=9903 r=r >+lexile-number 1=9903 r=r >+lex lexile-number >+Interest-age-level 1=9908 r=r >+Interest-grade-level 1=9909 r=r >+Reading-grade-level 1=9910 r=r > > #Accelerated Reader Level > arl 1=9904 r=r >diff --git a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >index 6b1fb87..b16d779 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >@@ -571,11 +571,25 @@ > <target_index>Abstract:w</target_index> > <target_index>Abstract:p</target_index> > </index_data_field> >- <!--record.abs line 153: melm 521$a lex:n--> >- <index_subfields tag="521" subfields="a"> >- <target_index>lex:w</target_index> >- <target_index>lex:p</target_index> >- <target_index>lex:n</target_index> >+ <index_subfields tag="521" subfields="a" condition="@ind1='0'"> >+ <target_index>Reading-grade-level:w</target_index> >+ <target_index>Reading-grade-level:p</target_index> >+ <target_index>Reading-grade-level:n</target_index> >+ </index_subfields> >+ <index_subfields tag="521" subfields="a" condition="@ind1='1'"> >+ <target_index>Interest-age-level:w</target_index> >+ <target_index>Interest-age-level:p</target_index> >+ <target_index>Interest-age-level:n</target_index> >+ </index_subfields> >+ <index_subfields tag="521" subfields="a" condition="@ind1='2'"> >+ <target_index>Interest-grade-level:w</target_index> >+ <target_index>Interest-grade-level:p</target_index> >+ <target_index>Interest-grade-level:n</target_index> >+ </index_subfields> >+ <index_subfields tag="521" subfields="a" condition="@ind1='8'"> >+ <target_index>lexile-number:w</target_index> >+ <target_index>lexile-number:p</target_index> >+ <target_index>lexile-number:n</target_index> > </index_subfields> > <!--record.abs line 154: melm 526$c arl,arl:n--> > <index_subfields tag="526" subfields="c"> >diff --git a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >index 604c76a..d1c4e23 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >@@ -472,13 +472,42 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:for-each> > </xslo:template> > <xslo:template mode="index_subfields" match="marc:datafield[@tag='521']"> >- <xslo:for-each select="marc:subfield"> >- <xslo:if test="contains('a', @code)"> >- <z:index name="lex:w lex:p lex:n"> >- <xslo:value-of select="."/> >- </z:index> >- </xslo:if> >- </xslo:for-each> >+ <xslo:if test="@ind1='0'"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('a', @code)"> >+ <z:index name="Reading-grade-level:w Reading-grade-level:p Reading-grade-level:n"> >+ <xslo:value-of select="."/> >+ </z:index> >+ </xslo:if> >+ </xslo:for-each> >+ </xslo:if> >+ <xslo:if test="@ind1='1'"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('a', @code)"> >+ <z:index name="Interest-age-level:w Interest-age-level:p Interest-age-level:n"> >+ <xslo:value-of select="."/> >+ </z:index> >+ </xslo:if> >+ </xslo:for-each> >+ </xslo:if> >+ <xslo:if test="@ind1='2'"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('a', @code)"> >+ <z:index name="Interest-grade-level:w Interest-grade-level:p Interest-grade-level:n"> >+ <xslo:value-of select="."/> >+ </z:index> >+ </xslo:if> >+ </xslo:for-each> >+ </xslo:if> >+ <xslo:if test="@ind1='8'"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('a', @code)"> >+ <z:index name="lexile-number:w lexile-number:p lexile-number:n"> >+ <xslo:value-of select="."/> >+ </z:index> >+ </xslo:if> >+ </xslo:for-each> >+ </xslo:if> > </xslo:template> > <xslo:template mode="index_subfields" match="marc:datafield[@tag='526']"> > <xslo:for-each select="marc:subfield"> >-- >2.1.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 14277
:
45783
|
46002
|
46005
|
46098
|
48651
|
50032
|
50036
|
50037