XML/RSS output (CGI only)

Top  Previous  Next

This option is only available for the CGI platform.

Zoom can now return search results in an OpenSearch compatible XML/RSS format. This allows for a number of possibilities including:

The ability for developers to post-process or reformat the search results using their own scripts or applications.
The possibility of providing RSS feeds for end-users to monitor the results for a subject they are interested in.
The ability to integrate your search engine with the increasing number of OpenSearch platforms and solutions out there. This includes the ability to submit your search engine to an aggregator such as a9.com, or as a search provider to IE7/Firefox browsers. See "OpenSearch compatibility".

lightbulb

Note: The XML/RSS output does not contain a search form so you will need to have a search form created on another page or script which passes the query to the CGI as HTTP GET parameters. The XML output is not designed to be an end-user interface. It was designed to be made available for parsing by scripting languages, 3rd party software and aggregators.

You can enable this as default behaviour by selecting the checkbox Use XML/RSS output on the "Advanced" tab of the Configuration window.

Alternatively, you can switch between HTML and XML/RSS output via a URL parameter of "zoom_xml".

So the following URL would display search results for "dog" in HTML:

search.cgi?zoom_query=dog&zoom_xml=0

 
And the following URL would display search results for "dog" in XML/RSS:

search.cgi?zoom_query=dog&zoom_xml=1

OpenSearch compatibility

With Zoom's XML/RSS output format being compatible with OpenSearch, you will be able to integrate your search engine with a number of OpenSearch platforms. This includes the ability to submit your search engine to an aggregator such as a9.com, or as a search provider to IE7/Firefox browsers. For more information on OpenSearch, please visit the websites: http://opensearch.a9.com/ and http://www.opensearch.org/

To configure your XML output for use with OpenSearch aggregators, you should specify channel information and an OpenSearch description file. To do this, click on the "Advanced" tab of the Configuration window, and click on the "Configure" button under the "XML/RSS output" section. This will bring up the XML/RSS output options.

screenshot_config_xml

Here you can specify the Title, Description, and URL of your search engine. This is what the OpenSearch aggregator will use to identify your search engine.

You can also specify the URL to your OpenSearch description file here. This is a XML file which you host on your website, containing information on how the aggregator can send queries to your search engine.

The XSLT URL allows you to specify a XSL (Extensible Stylesheet Language) Transformation file to transform the XML output to another required XML format or document. You can find out more about this here:
http://www.w3.org/TR/xslt

For more information on the official OpenSearch specifications for details on the description file and Query Syntax:
http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document

The following is an example of a description file for a CGI search engine created with Zoom:

<?xml version="1.0" encoding="UTF-8"?>

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">

  <ShortName>Bob's Search Engine for Cars</ShortName>

  <Description>Search engine for all things cars and automobile</Description>

  <Contact>bob@bobcars.com</Contact>

  <Url type="application/rss+xml" 

       template="http://www.bobcars.com/cgi-bin/search.cgi?zoom_query={searchTerms}

       &amp;zoom_page={startPage?}&amp;zoom_per_page={count?}&amp;zoom_and={searchAll?}

       &amp;zoom_cat&#91;&#93;={category1?}&amp;zoom_cat&#91;&#93;={category2?}"/>

</OpenSearchDescription>

 

Highlighting within XML results (context only)

This option enables highlighting within the context description returned in the XML results. This is disabled by default to return a more natural XML response (so that <zoom:context> contains text rather than XML). By enabling this option, highlighting will be indicated by <zoom:highlight> tags within the <zoom:context> tag content.