April 18, 2006

ROUTES AJAX Search

Just going through the bombsite that is my mailbox, I came across a message I meant to blog but didn't: a demo AJAX based search for the OU ROUTES service:

AJAXy ROUTES Search.

A the moment, this searches over item descriptions (I think). I did wonder whether the following would be useful:

http://routes.open.ac.uk/routes_xml_search_rss.php?search=spanish&type=keyword
http://routes.open.ac.uk/routes_xml_search_rss.php?search=spanish&type=description
http://routes.open.ac.uk/routes_xml_search_rss.php?search=spanish&type=all

although it has the downside of being bespoke rather than compliant with some standard.

With IE7 consuming the opensearch (http://opensearch.a9.com/spec/1.1/) format, it would be good to see ROUTES search becoming OpenSearch compliant.

As a first (untested) guess, I imagine the OpenSearch definition might look something like this:

<?xml version=”1.0” encoding=”UTF-8”?>
<OpenSearchDescription xmlns=”http://a9.com/-/spec/opensearchdescription/1.1/”>
<ShortName>OU-ROUTES</ShortName>
<Description>Open University Example ROUTES Search</Description>
<Tags>OU ROUTES</Tags>
<Contact>J.C.Mcnulty@open.ac.uk</Contact>

<Url type="application/rss+xml" template="http://routes.open.ac.uk/routes_xml_search_rss.php?search={searchTerms}"/>
</OpenSearchDescription>

or perhaps even:

<Url type="application/rss+xml" template="http://routes.open.ac.uk/routes_xml_search_rss.php?search={searchTerms}&type={description}"/>


For OpenSearch compliance, I think there are a couple of tweaks required to the ROUTES RSS output:

RSS namespace:

<rss version="2.0" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">

In the <channel>, before the first item:

<opensearch:totalResults> WHATEVER THE TOTAL NUMBER OF RESULTS IS</opensearch:totalResults>
<opensearch:startIndex>THE NUMBER OF THE FIRST RESULT RETURNED</opensearch:startIndex>
<opensearch:itemsPerPage>THE NUMBER OF ITEMS <opensearch:link rel="search" href="http://routes.open.ac.uk/testOpensearchDescription.OR_WHATEVER.xml" type="application/opensearchdescription+xml"/>
<opensearch:Query role="request" searchTerms="THE SEARCH TERMS" />

Posted by ajh59 at April 18, 2006 02:25 PM
Comments