From 4a3ec3fe2973f4b57a33b358d45f65dd27c79dd9 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Sun, 16 Oct 2011 12:45:52 -0400 Subject: [PATCH] LP875819: Fix SRU and Z39.50 default search index failures Per http://www.loc.gov/standards/sru/specs/cql.html : All parts of CQL are case insensitive [...] If any case insensitive part of CQL is specified with both upper and lower case, it is for aesthetic purposes only. So fold the SRU qualifier and relation to lower case. This then matches the srw.serverchoice entry that we already have in config.metabib_search_alias so that default searches will successfully point to the keyword index. Signed-off-by: Dan Scott --- Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm index 708cc22478..9a36347ff7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm @@ -1954,6 +1954,15 @@ sub sru_search { if ( $qualifier ) { my ($qset, $qname) = split(/\./, $qualifier); + # Per http://www.loc.gov/standards/sru/specs/cql.html + # "All parts of CQL are case insensitive [...] If any case insensitive + # part of CQL is specified with both upper and lower case, it is for + # aesthetic purposes only." + + # So fold the qualifier and relation to lower case + $qset = lc($qset); + $qname = lc($qname); + if ( exists($qualifier_map{$qset}{$qname}) ) { $qualifier = $qualifier_map{$qset}{$qname}{'index'} || 'kw'; $log->debug("SRU toEvergreen: $qset, $qname $qualifier_map{$qset}{$qname}{'index'}\n"); -- 2.11.0