From b35b1960e9acce011964e15bdff3c784f5db9f84 Mon Sep 17 00:00:00 2001 From: gfawcett Date: Fri, 17 Dec 2010 04:05:40 +0000 Subject: [PATCH] trying opensrf for search instead of z39.50, for performance comparison. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@1109 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- conifer/integration/uwindsor.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/conifer/integration/uwindsor.py b/conifer/integration/uwindsor.py index 3b882f1..bc1050c 100644 --- a/conifer/integration/uwindsor.py +++ b/conifer/integration/uwindsor.py @@ -103,9 +103,21 @@ def cat_search(query, start=1, limit=10): results = M.marcxml_to_records(I.url_to_marcxml(query)) numhits = len(results) else: - # query is an actual Z39.50 query - cat_host, cat_port, cat_db = settings.Z3950_CONFIG - results, numhits = PZ.search(cat_host, cat_port, cat_db, query, start, limit) + # query is an actual query + superpage = E1('open-ils.search.biblio.multiclass.query', + {"org_unit":106,"depth":1,"limit":limit,"offset":start-1,"visibility_limit":3000, + "default_class":"keyword"}, + query, 1) + ids = [id for (id,) in superpage['ids']] + results = [] + for rec in E1('open-ils.supercat.record.object.retrieve', ids): + marc = unicode(rec['marc'], 'utf-8') + tree = M.marcxml_to_records(marc)[0] + results.append(tree) + numhits = int(superpage['count']) + # # query is an actual Z39.50 query + # cat_host, cat_port, cat_db = settings.Z3950_CONFIG + # results, numhits = PZ.search(cat_host, cat_port, cat_db, query, start, limit) return results, numhits def bib_id_to_marcxml(bib_id): -- 2.11.0