SRU qualifiers should be case-insensitive

Bug #875819 reported by Dan Scott
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Status tracked in Main
2.1
Fix Released
High
Lebbeous Fogle-Weekley
Main
Fix Released
High
Lebbeous Fogle-Weekley

Bug Description

* Evergreen master
* Fedora 15

SRU (and Z39.50) searches against Evergreen using the default, unspecified index currently always return 0 results because the request is translated to "srw.ServerChoice" and config.metabib_search_alias contains an entry for "srw.serverchoice".

We could add case-sensitive aliases for that qualifier to config.metabib_search_alias, but http://www.loc.gov/standards/sru/specs/cql.html points the way: "12. Case Insensitive: All parts of CQL are case insensitive apart from user supplied search terms, values for modifiers and prefix map identifiers, which may or may not be case sensitive. If any case insensitive part of CQL is specified with both upper and lower case, it is for aesthetic purposes only."

Instead, we can simply lc() the incoming qualifier in OpenILS::WWW::SuperCat.pm and match the lowercase search alias accordingly.

Tags: pullrequest
Revision history for this message
Dan Scott (denials) wrote :

Pushed user/dbs/LP875819-fix-SRU-qualifier to @working repo to resolve this problem

tags: added: pullrequest
Revision history for this message
Dan Scott (denials) wrote :

Also pushed user/dbs/LP875819-fix-SRU-qualifier_2_1 to @working to fix the problem there.

Changed in evergreen:
milestone: none → 2.1.1
Revision history for this message
Dan Scott (denials) wrote :

For a simple test that demonstrates the problem in action:

1) Add a bib record with call number and copy in "available" status to your test system. Ensure it has the keyword "apache" somewhere.

2) Hit http://localhost/opac/extras/sru?version=1.1&operation=searchRetrieve&query=apache with your HTTP user agent of choice. You'll see no hits, and the default index that is chosen is "srw.ServerChoice"

3) Hit http://localhost/opac/extras/sru?version=1.1&operation=searchRetrieve&query=srw.serverchoice=apache with your HTTP user agent of choice. Now that we've qualified the search query with an index, and we've passed the lower case version of it that matches the entry in config.metabib_search_alias, we get a search result back.

4) For good measure, hit http://localhost/opac/extras/sru?version=1.1&operation=searchRetrieve&query=srw.ServerChoice=apache and note that you get no hits.

5) Drop in the updated SuperCat.pm and restart Apache to get the case-insensitive matching happening. Hit http://localhost/opac/extras/sru?version=1.1&operation=searchRetrieve&query=srw.ServerChoice=apache and note that you now get hits (assuming your HTTP user agent of choice hasn't cached the previous results).

Revision history for this message
Lebbeous Fogle-Weekley (lebbeous) wrote :

This is what actually happens on my system when I try any of your example requests with the patched SuperCat.pm

[Wed Oct 19 16:49:36 2011] [error] [client a.b.c.d] Can't locate object method "getModifiers" via package "cql::relation=hash(0x7f90e1a6d550)" (perhaps you forgot to load "cql::relation=hash(0x7f90e1a6d550)"?) at /usr/local/share/perl/5.10.1/OpenILS/WWW/SuperCat.pm line 1971.\n

:-(

Revision history for this message
Dan Scott (denials) wrote :

Thanks for testing - that's why we have sign-offs even on seemingly obvious commits, right? I've force-pushed fixed versions of the branches, please try again if you have the time.

Revision history for this message
Lebbeous Fogle-Weekley (lebbeous) wrote :

An amended commit on the branch for master tested successfully.
Signed off and pushed amended commits to master and to rel_2_1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.