--- /dev/null
+[%-
+USE CGI;
+USE WebSession;
+WebSession.bootstrap();
+
+rank_threshold = 5000;
+
+itempage = CGI.param('itempage');
+
+#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';
+
+session = WebSession.init_app_session('open-ils.search');
+
+type = CGI.param('mr_search_type');
+string = CGI.param('mr_search_query');
+location = CGI.param('mr_search_location');
+depth = CGI.param('mr_search_depth');
+limit = pagesize;
+offset = itempage * pagesize - 1;
+
+pagesize = 10;
+IF CGI.param('pagesize');
+ pagesize = CGI.param('pagesize');
+END;
+
+req = session.request(count_meth, type, string, location, depth);
+req.wait_complete();
+
+count = req.recv();
+req.finish;
+
+IF count > rank_threshold;
+ search_meth = 'open-ils.search.biblio.class.unorded';
+END;
+
+req = session.request(search_meth, type, string, location, depth, limit, offset);
+req.wait_complete();
+
+list = req.recv();
+req.finish;
+
+-%]
+<?xml version="1.0"?>
+<rss version="2.0" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">
+ <channel>
+ <title>Pines Catalogue Search: [% string %] </title>
+ <link>http://http://gapines.org/opensearch.ttk/?target=mr_result&mr_search_type=[% type %]&mr_search_query=[% string %]&itempage=[% itempage %]&mr_search_depth=[% depth %]&mr_search_location=[% location %]</link>
+ <description>Search results for "[% string %]" at gapines.org</description>
+ <language>en-us</language>
+ <copyright>&copy;2004-2005, Georga Public Library Service.</copyright>
+ <openSearch:totalResults>[% count %]</openSearch:totalResults>
+ <openSearch:startIndex>[% offset + 1 %]</openSearch:startIndex>
+ <openSearch:itemsPerPage>[% pagesize %]</openSearch:itemsPerPage>
+[%-
+
+FOREACH mr_id IN list;
+ req = session.request('open-ils.search.biblio.metarecord.mods_slim.retrieve', mr_id);
+ req.wait_complete();
+
+ mods = req.recv();
+ req.finish;
+
+-%]
+ <item>
+ <title>[% mods.title() %]</title>
+ <link>http://gapines.org/opac/?target=record_result&page=0&mrid=[% mr_id %]&hits_per_page=10</link>
+ <description>
+ <b>Author:</b> [% mods.author() %]<br>
+ <b>Subjects:</b>
+[%-
+ FOREACH sub IN mods.subject();
+ IF loop.count() > 5;
+ ', ...';
+ LAST;
+ END;
+ IF loop.index;
+ ', ';
+ END;
+ sub.list.0;
+ END;
+-%]
+ </description>
+ </item>
+[%-
+
+END;
+
+ -%]
+</rss>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearchdescription/1.0/">
+ <Url>http://gapines.org/opensearch.ttk/?target=mr_result&mr_search_type=keyword&mr_search_query={searchTerms}&itempage={startPage}&mr_search_depth=0&mr_search_location=1</Url>
+ <Format>http://a9.com/-/spec/opensearchrss/1.0/</Format>
+ <ShortName>Pines</ShortName>
+ <LongName>Pines Consortium Catalogue</LongName>
+ <Description>Search for books in Pines.</Description>
+ <Tags>book library research</Tags>
+ <Image>http://gapines.org/images/small_logo.jpg</Image>
+ <SampleSearch>harry potter</SampleSearch>
+ <Developer>GPLS</Developer>
+ <Contact>mrylander@gmail.com</Contact>
+ <Attribution>Product and search data &copy; 2005, Georgia Public Library Service, All Rights Reserved</Attribution>
+ <SyndicationRight>open</SyndicationRight>
+ <AdultContent>false</AdultContent>
+</OpenSearchDescription>