z39.50 searches include spurious keyword term
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Evergreen Versions: 2.10.7 & Master
OpenSRF Versions: 2.4.1 & Master
Pg Versions: 9.2 & 9.5
When doing a z39.50 search against Evergreen, I've seen that a spurious keyword term is apparently included. Here is the log for a search for Mozart against concerto from a freshly compiled master:
[2017-02-07 20:28:24] open-ils.search [INFO:21405:
The {"keyword"
The above was produced by doing a search with yaz-client:
find @attr 1=1003 mozart
I've similar examples with production data on 2.10.7 both on a test vm and a live, production server. Every Z39.50 search apparently gets that extra search term added.
It does not appear to affect search results as the following SRU search claims to return 11 results, though in my test, I only counted 10 <recordData> tags.
The above is what I considered the equivalent SRU search.
The above tests should be reproducible by anyone using the concerto dataset.
description: | updated |
Here are log entries from the Z39.50 search. (Don't mind the timestamp differences. My VM apparently can't decide if it is in EST or UTC.)
Apache other_vhosts_ access_ log:
localhost:80 ::1 - - [07/Feb/ 2017:16: 33:40 -0500] "GET /opac/extras/ sru/CONS/ holdings? version= 1.2&operation= searchRetrieve& query=eg. author% 20%3D%20mozart& startRecord= 1&maximumRecord s=0 HTTP/1.1" 200 129771 "-" "YAZ/4.2.30"
SRU conversion from osrfsys.log:
[2017-02-07 16:33:40] /usr/sbin/apache2 [INFO:1863: SuperCat. pm:1996: 148650319118639 ] SRU search string [eg.author = mozart] converted to [eg.author:mozart site:CONS]
How Evergreen interpreted the search:
[2017-02-07 21:33:42] open-ils.search [INFO:1790: Biblio. pm:964: 148650319118631 0] compiled search is {"org_unit" :1,"offset" :0,"skip_ check": 0,"limit" :10,"searches" :{"keyword" :{"term" :"eg."} ,"author" :{"term" :"mozart" }},"estimation_ strategy" :"inclusion" ,"check_ limit": "1000", "depth" :0,"core_ limit": 10000}
Here are the same for the equivalent SRU search, i.e. the one in the main description:
Apache log:
localhost:80 192.168.122.1 - - [07/Feb/ 2017:16: 51:21 -0500] "GET /opac/extras/ sru/CONS/ holdings? version= 1.1&operation= searchRetrieve& query=eg. author% 3Dmozart& maximumRecords= 0 HTTP/1.1" 200 129797 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/ 55.0.2883. 87 Chrome/55.0.2883.87 Safari/537.36"
SRU conversion:
[2017-02-07 16:51:21] /usr/sbin/apache2 [INFO:1889: SuperCat. pm:1996: 148650319118899 ] SRU search string [eg.author=mozart] converted to [eg.author:mozart site:CONS]
The actual search:
[2017-02-07 21:51:22] open-ils.search [INFO:1790: Biblio. pm:964: 148650319118891 0] compiled search is {"check_ limit": "1000", "core_limit" :10000, "depth" :0,"searches" :{"keyword" :{"term" :"eg."} ,"author" :{"term" :"mozart" }},"estimation_ strategy" :"inclusion" ,"org_unit" :1,"offset" :0,"skip_ check": 0,"limit" :10}
I want to add one more entry. Changing the version in the URL to 1.2 produces the following search log entry:
[2017-02-07 21:56:59] open-ils.search [INFO:1790: Biblio. pm:964: 148650319118591 0] compiled search is {"org_unit" :1,"offset" :0,"limit" :10,"skip_ check": 0,"check_ limit": "1000", "core_limit" :10000, "depth" :0,"searches" :{"keyword" :{"term" :"eg."} ,"author" :{"term" :"mozart" }},"estimation_ strategy" :"inclusion" }
I believe the original problem description is not quite accurate. The issue seems to be with specifying version 1.2 to SRU. I may update the bug title/initial description later.