From 2d83d4d432ff76521a06fa000439ee65592fb4b4 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 Signed-off-by: Lebbeous Fogle-Weekley --- Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm index 708cc22478..280a7cc724 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm @@ -1950,6 +1950,15 @@ sub sru_search { my $term = $self->getTerm(); my $relation = $self->getRelation(); + # 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 + $qualifier = lc($qualifier); + $relation = $relation; + my $query; if ( $qualifier ) { my ($qset, $qname) = split(/\./, $qualifier); @@ -1959,7 +1968,7 @@ sub sru_search { $log->debug("SRU toEvergreen: $qset, $qname $qualifier_map{$qset}{$qname}{'index'}\n"); } - my @modifiers = $relation->getModifiers(); + my @modifiers = map lc, $relation->getModifiers(); my $base = $relation->getBase(); if ( grep { $base eq $_ } qw/= scr exact all/ ) { -- 2.11.0