From 6dd386091ff201e53ed6deba894be8d3df7e4a5e Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 27 Jan 2006 16:17:56 +0000 Subject: [PATCH] opensearch cleanup git-svn-id: svn://svn.open-ils.org/ILS/trunk@2855 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/extras/opensearch.ttk | 38 ++++++++----------- Open-ILS/src/extras/opensearch.xml | 19 +++++----- Open-ILS/src/extras/opensearchportal.html | 4 +- .../Application/Storage/Publisher/metabib.pm | 12 ++++-- 4 files changed, 35 insertions(+), 38 deletions(-) diff --git a/Open-ILS/src/extras/opensearch.ttk b/Open-ILS/src/extras/opensearch.ttk index ba76495aae..3af25244ad 100644 --- a/Open-ILS/src/extras/opensearch.ttk +++ b/Open-ILS/src/extras/opensearch.ttk @@ -4,6 +4,7 @@ USE ws = WebSession; j = ws.bootstrap_client("/pines/conf/bootstrap.conf"); rank_threshold = 5000; +base_url = 'http://fw1/'; pagesize = 10; IF CGI.param('pagesize'); @@ -12,9 +13,6 @@ END; itempage = CGI.param('page'); -#type,string,location,depth -count_meth = 'open-ils.search.biblio.class.count'; - #type,string,location,depth,limit,offset search_meth = 'open-ils.search.biblio.class'; @@ -24,7 +22,7 @@ type = CGI.param('mr_search_type'); string = CGI.param('mr_search_query'); location = CGI.param('mr_search_location'); depth = CGI.param('mr_search_depth'); -max_rank = CGI.param('max_rank'); +max_rank = CGI.param('max_rank') || 0; limit = pagesize; offset = (itempage - 1) * pagesize; @@ -32,30 +30,25 @@ IF offset < 0; offset = 0; END; -count_req = session.request(count_meth, type, string, location, depth); id_req = session.request(search_meth, type, string, location, depth, limit, offset); -j = count_req.wait_complete(); -count = count_req.recv().content(); -j = count_req.finish; - j = id_req.wait_complete(); list = id_req.recv().content(); j = id_req.finish; +count = list.count; + IF max_rank == '{relevanceScale}'; max_rank = 0; END; -%] - + Pines Catalogue Search: [% string | html %] - http://gapines.org/opensearch/?target=mr_result&mr_search_type=[% type %]&mr_search_query=[% string | uri | html %]&page=[% itempage %]&mr_search_depth=[% depth %]&mr_search_location=[% location %]&pagesize=[% pagesize %]&max_rank=[% max_rank %] - Search results for "[% string | html %]" at gapines.org + [% base_url %]/opac/extras/opensearch/?target=mr_result&mr_search_type=[% type %]&mr_search_query=[% string | uri | html %]&page=[% itempage %]&mr_search_depth=[% depth %]&mr_search_location=[% location %]&pagesize=[% pagesize %]&max_rank=[% max_rank %] + Search results for "[% string | html %]" at dev.gapines.org en-us &copy;2004-2005, Georga Public Library Service. [% count %] @@ -66,33 +59,35 @@ END; mr_list = list.ids; -FOREACH mr_id IN mr_list; +FOREACH mr_id = mr_list; req = session.request('open-ils.search.biblio.metarecord.mods_slim.retrieve', mr_id.0); j = req.wait_complete(); IF max_rank == 0; max_rank = mr_id.1; + ' ' _ max_rank _ "\n"; END; - ' ' _ max_rank _ "\n"; rank = mr_id.1 / max_rank; rank = rank * 100; rank = rank.split('\.').0; + #''; + mods = req.recv().content(); j = req.finish; -%] [% mods.title() | html %] - http://gapines.org/opac/?sub_frame=1&target=record_result&page=0&mrid=[% mr_id.0 %]&hits_per_page=10 - [% rank %] + [% base_url %]/opac/en-US/skin/default/xml/rresult.xml?m=[% mr_id.0 %]&l=[% location %] + [% rank %] [%- IF mods.isbn(); -%] <div style="float: left;"> - <a href="http://gapines.org/opac/?sub_frame=1&target=record_result&page=0&mrid=[% mr_id.0 %]&hits_per_page=10"> + <a href="[% base_url %]/opac/en-US/skin/default/xml/rresult.xml?m=[% mr_id.0 %]&l=[% location %]"> <img style="padding: 3px; border: none;" width="45" @@ -104,7 +99,7 @@ FOREACH mr_id IN mr_list; END; IF mods.author(); -%] - <b>Author:</b> <a href="http://gapines.org/opac/?sub_frame=1&target=mr_result&mr_search_type=author&mr_search_query=[% mods.author() | uri | html %]&page=0&mr_search_depth=[% depth %]&mr_search_location=[% location %]">[% mods.author() | html %]</a><br> + <b>Author:</b> <a href="[% base_url %]/opac/en-US/skin/default/xml/mresult.xml?tp=author&t=[% mods.author() | uri | html %]&l=[% location %]">[% mods.author() | html %]</a><br> [% END; IF mods.subject(); @@ -120,7 +115,7 @@ FOREACH mr_id IN mr_list; ', '; END; -%] -<a href="http://gapines.org/opac/?sub_frame=1&target=mr_result&mr_search_type=subject&mr_search_query=[% sub | uri | html %]&page=0&mr_search_depth=[% depth %]&mr_search_location=[% location %]">[% sub | html %]</a>[% +<a href="[% base_url %]/opac/en-US/skin/default/xml/mresult.xml?tp=subject&mr_search_query=[% sub | uri | html %]">[% sub | html %]</a>[% END; %] <br> @@ -159,7 +154,6 @@ FOREACH mr_id IN mr_list; END; %] - <b>Copies Available:</b> [% mr_id.2 %] [%- diff --git a/Open-ILS/src/extras/opensearch.xml b/Open-ILS/src/extras/opensearch.xml index 417656c12d..5f509177a8 100644 --- a/Open-ILS/src/extras/opensearch.xml +++ b/Open-ILS/src/extras/opensearch.xml @@ -1,18 +1,17 @@ - http://gapines.org/opensearch/?target=mr_result&mr_search_type=keyword&mr_search_query={searchTerms}&page={startPage}&mr_search_depth=0&mr_search_location=1&pagesize={count}&max_rank={relevanceScale} + xmlns="http://a9.com/-/spec/opensearchdescription/1.0/"> + http://dev.gapines.org/opac/extras/opensearch?target=mr_result&mr_search_type=keyword&mr_search_query={searchTerms}&page={startPage}&mr_search_depth=0&mr_search_location=1&pagesize={count}&max_rank={relevanceScale} http://a9.com/-/spec/opensearchrss/1.0/ - Evergreen DEMO - Pines Consortium DEMO OpenSearch Catalogue - Search for books in Pines. - book library research Evergreen Open-ILS GPLS - http://gapines.org/images/small_logo.jpg + Evergreen/OpenILS DEMO + PINES Consortium Evergreen/OpenILS DEMO OpenSearch Catalog + Search for books in the PINES Catalog. + book library research Evergreen Open-ILS OpenILS PINES GPLS + http://dev.gapines.org/opac/images/small_logo.jpg harry potter - GPLS + GPLS, Mike Rylander mrylander@gmail.com - Product and search data &copy; 2005, Georgia Public Library Service, All Rights Reserved + Product and search data &copy; 2005-2006, Georgia Public Library Service, All Rights Reserved open false diff --git a/Open-ILS/src/extras/opensearchportal.html b/Open-ILS/src/extras/opensearchportal.html index fb61321a41..4fa33b481e 100644 --- a/Open-ILS/src/extras/opensearchportal.html +++ b/Open-ILS/src/extras/opensearchportal.html @@ -123,7 +123,7 @@ function create_requestor () { return req; } -var proxy = 'http://gapines.org/opensearch/?fetch='; +var proxy = 'http://dev.gapines.org/opac/extras/opensearch/?fetch='; var insearch=false; @@ -610,7 +610,7 @@ var listening_elements = ['term','gobutton','res_count_per','res_type']; }" name="source" type="checkbox" - value="http://gapines.org/opensearch.xml" + value="http://dev.gapines.org/opac/extras/opensearch.xml" checked>GPLS Pines diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm index c62235c2f5..802b90f835 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm @@ -712,6 +712,7 @@ sub search_class_fts_count { SELECT count(distinct m.metarecord) FROM $search_table f, $metabib_metarecord_source_map_table m, + $metabib_metarecord_source_map_table mr, $asset_call_number_table cn, $asset_copy_table cp, $cs_table cs, @@ -719,7 +720,8 @@ sub search_class_fts_count { $metabib_record_descriptor rd, $descendants d WHERE $fts_where - AND m.source = f.source + AND mr.source = f.source + AND mr.metarecord = m.metarecord AND cn.record = m.source AND rd.record = m.source AND cp.status = cs.id @@ -735,9 +737,11 @@ sub search_class_fts_count { SELECT count(distinct m.metarecord) FROM $search_table f, $metabib_metarecord_source_map_table m, + $metabib_metarecord_source_map_table mr, $metabib_record_descriptor rd WHERE $fts_where - AND m.source = f.source + AND mr.source = f.source + AND mr.metarecord = m.metarecord AND rd.record = m.source $t_filter $f_filter @@ -848,9 +852,9 @@ sub new_search_class_fts { $metabib_metarecord_source_map_table mr, $metabib_record_descriptor rd WHERE $fts_where - AND m.source = f.source + AND mr.source = f.source AND mr.metarecord = m.metarecord - AND rd.record = mr.source + AND rd.record = m.source $t_filter $f_filter AND EXISTS ( -- 2.43.2