From 690ab60da27fb9792feecbfa399b86c1b7a53d41 Mon Sep 17 00:00:00 2001 From: Barton Chittenden 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 Signed-off-by: Hector Castro Works as advertised Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jesse Weaver --- 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 2139c5a826..9f8f219254 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1020,6 +1020,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 @@ -1125,6 +1130,8 @@ sub getIndexes{ 'Illustration-code', 'Index-term-genre', 'Index-term-uncontrolled', + 'Interest-age-level', + 'Interest-grade-level', 'ISBN', 'isbn', 'ISSN', @@ -1139,6 +1146,7 @@ sub getIndexes{ 'LC-card-number', 'lcn', 'lex', + 'lexile-number', 'llength', 'ln', 'ln-audio', @@ -1175,6 +1183,7 @@ sub getIndexes{ 'Publisher', 'Provider', 'pv', + 'Reading-grade-level', 'Record-control-number', 'rcn', 'Record-type', @@ -1516,8 +1525,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 @@ -1746,6 +1755,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 d34325a1b6..ff63a36c88 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 6ce7af07a0..873c74938b 100644 --- a/etc/zebradb/ccl.properties +++ b/etc/zebradb/ccl.properties @@ -1137,7 +1137,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 8c53c3aa99..31c46ced4c 100644 --- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml +++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml @@ -570,11 +570,25 @@ Abstract:w Abstract:p - - - lex:w - lex:p - lex:n + + Reading-grade-level:w + Reading-grade-level:p + Reading-grade-level:n + + + Interest-age-level:w + Interest-age-level:p + Interest-age-level:n + + + Interest-grade-level:w + Interest-grade-level:p + Interest-grade-level:n + + + lexile-number:w + lexile-number:p + lexile-number:n 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 50c62d3fff..35ae2416ce 100644 --- a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl +++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl @@ -474,13 +474,42 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.39.5